@rotorsoft/gent 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/README.md +397 -0
- package/dist/chunk-NRTQPDZB.js +667 -0
- package/dist/chunk-NRTQPDZB.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1184 -0
- package/dist/index.js.map +1 -0
- package/dist/setup-labels-2YOKZ2AK.js +8 -0
- package/dist/setup-labels-2YOKZ2AK.js.map +1 -0
- package/package.json +87 -0
- package/templates/.gent.yml +61 -0
- package/templates/AGENT.md +108 -0
- package/templates/issue-template.md +44 -0
package/README.md
ADDED
|
@@ -0,0 +1,397 @@
|
|
|
1
|
+
# @rotorsoft/gent
|
|
2
|
+
|
|
3
|
+
AI-powered GitHub workflow CLI - leverage Claude AI to create tickets, implement features, and manage PRs.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
`gent` is a command-line tool that integrates Claude AI with GitHub to automate your development workflow:
|
|
8
|
+
|
|
9
|
+
- **Create AI-enhanced tickets** - Describe what you need, Claude generates detailed GitHub issues with proper labels
|
|
10
|
+
- **Implement with AI** - Pick a ticket and let Claude implement it with automatic branch management
|
|
11
|
+
- **Track progress** - Maintain a progress log for context across AI sessions
|
|
12
|
+
- **Create smart PRs** - Generate AI-enhanced pull requests with proper descriptions
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
pnpm add -g @rotorsoft/gent
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
### Prerequisites
|
|
21
|
+
|
|
22
|
+
- **Node.js** 20 or higher
|
|
23
|
+
- **GitHub CLI** (`gh`) - [Install](https://cli.github.com/)
|
|
24
|
+
- **Claude CLI** - [Install](https://claude.ai/code)
|
|
25
|
+
|
|
26
|
+
Verify prerequisites:
|
|
27
|
+
```bash
|
|
28
|
+
gh auth status # Should show authenticated
|
|
29
|
+
claude --version # Should show version
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Quick Start
|
|
33
|
+
|
|
34
|
+
### 1. Initialize your repository
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
cd your-repo
|
|
38
|
+
gent init
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
This creates:
|
|
42
|
+
- `.gent.yml` - Configuration file
|
|
43
|
+
- `AGENT.md` - AI instructions for your project
|
|
44
|
+
- `progress.txt` - Progress tracking log
|
|
45
|
+
|
|
46
|
+
### 2. Setup GitHub labels
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
gent setup-labels
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Creates workflow labels (`ai-ready`, `ai-in-progress`, etc.) and category labels.
|
|
53
|
+
|
|
54
|
+
### 3. Create a ticket
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
gent create "Add user authentication with JWT tokens"
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Claude will:
|
|
61
|
+
- Generate a detailed issue with technical context
|
|
62
|
+
- Infer appropriate labels (type, priority, risk, area)
|
|
63
|
+
- Create the issue on GitHub with `ai-ready` label
|
|
64
|
+
|
|
65
|
+
### 4. Implement a ticket
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
# Pick a specific issue
|
|
69
|
+
gent run 123
|
|
70
|
+
|
|
71
|
+
# Or auto-select highest priority ai-ready issue
|
|
72
|
+
gent run --auto
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Claude will:
|
|
76
|
+
- Create a feature branch
|
|
77
|
+
- Update labels to `ai-in-progress`
|
|
78
|
+
- Implement the feature following your `AGENT.md` instructions
|
|
79
|
+
- Run validation commands
|
|
80
|
+
- Create a commit
|
|
81
|
+
- Update labels to `ai-completed`
|
|
82
|
+
|
|
83
|
+
### 5. Create a pull request
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
gent pr
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Claude will:
|
|
90
|
+
- Generate a PR description from commits and linked issue
|
|
91
|
+
- Include "Closes #" reference
|
|
92
|
+
- Create the PR on GitHub
|
|
93
|
+
|
|
94
|
+
## Commands
|
|
95
|
+
|
|
96
|
+
### `gent init`
|
|
97
|
+
|
|
98
|
+
Initialize gent workflow in current repository.
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
gent init [--force]
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Options:
|
|
105
|
+
- `-f, --force` - Overwrite existing configuration
|
|
106
|
+
|
|
107
|
+
### `gent setup-labels`
|
|
108
|
+
|
|
109
|
+
Setup GitHub labels for AI workflow.
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
gent setup-labels
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
Creates labels in these categories:
|
|
116
|
+
- **Workflow**: `ai-ready`, `ai-in-progress`, `ai-completed`, `ai-blocked`
|
|
117
|
+
- **Priority**: `priority:critical`, `priority:high`, `priority:medium`, `priority:low`
|
|
118
|
+
- **Risk**: `risk:low`, `risk:medium`, `risk:high`
|
|
119
|
+
- **Type**: `type:feature`, `type:fix`, `type:refactor`, `type:chore`, `type:docs`, `type:test`
|
|
120
|
+
- **Area**: `area:ui`, `area:api`, `area:database`, `area:workers`, `area:shared`, `area:testing`, `area:infra`
|
|
121
|
+
|
|
122
|
+
### `gent create <description>`
|
|
123
|
+
|
|
124
|
+
Create an AI-enhanced GitHub issue.
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
gent create "Add dark mode toggle to settings page"
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### `gent list`
|
|
131
|
+
|
|
132
|
+
List GitHub issues by label/status.
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
gent list # Show ai-ready issues
|
|
136
|
+
gent list --status in-progress # Show ai-in-progress issues
|
|
137
|
+
gent list --label priority:high # Filter by label
|
|
138
|
+
gent list --status all --limit 50 # Show all issues
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
Options:
|
|
142
|
+
- `-l, --label <label>` - Filter by label
|
|
143
|
+
- `-s, --status <status>` - Filter by workflow status (ready, in-progress, completed, blocked, all)
|
|
144
|
+
- `-n, --limit <number>` - Maximum issues to show (default: 20)
|
|
145
|
+
|
|
146
|
+
### `gent run [issue-number]`
|
|
147
|
+
|
|
148
|
+
Run Claude to implement a GitHub issue.
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
gent run 123 # Implement issue #123
|
|
152
|
+
gent run --auto # Auto-select highest priority ai-ready issue
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
Options:
|
|
156
|
+
- `-a, --auto` - Auto-select highest priority ai-ready issue
|
|
157
|
+
|
|
158
|
+
### `gent pr`
|
|
159
|
+
|
|
160
|
+
Create an AI-enhanced pull request.
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
gent pr # Create PR
|
|
164
|
+
gent pr --draft # Create as draft PR
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
Options:
|
|
168
|
+
- `-d, --draft` - Create as draft PR
|
|
169
|
+
|
|
170
|
+
### `gent status`
|
|
171
|
+
|
|
172
|
+
Show current workflow status.
|
|
173
|
+
|
|
174
|
+
```bash
|
|
175
|
+
gent status
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
Displays:
|
|
179
|
+
- Configuration status
|
|
180
|
+
- Prerequisites check
|
|
181
|
+
- Git status (branch, commits, changes)
|
|
182
|
+
- Linked issue status
|
|
183
|
+
- PR status
|
|
184
|
+
- Suggested actions
|
|
185
|
+
|
|
186
|
+
## Configuration
|
|
187
|
+
|
|
188
|
+
### .gent.yml
|
|
189
|
+
|
|
190
|
+
Main configuration file. Created by `gent init`.
|
|
191
|
+
|
|
192
|
+
```yaml
|
|
193
|
+
version: 1
|
|
194
|
+
|
|
195
|
+
github:
|
|
196
|
+
labels:
|
|
197
|
+
workflow:
|
|
198
|
+
ready: "ai-ready"
|
|
199
|
+
in_progress: "ai-in-progress"
|
|
200
|
+
completed: "ai-completed"
|
|
201
|
+
blocked: "ai-blocked"
|
|
202
|
+
types: [feature, fix, refactor, chore, docs, test]
|
|
203
|
+
priorities: [critical, high, medium, low]
|
|
204
|
+
risks: [low, medium, high]
|
|
205
|
+
areas: [ui, api, database, workers, shared, testing, infra]
|
|
206
|
+
|
|
207
|
+
branch:
|
|
208
|
+
pattern: "{author}/{type}-{issue}-{slug}"
|
|
209
|
+
author_source: "git" # git | env | prompt
|
|
210
|
+
author_env_var: "GENT_AUTHOR"
|
|
211
|
+
|
|
212
|
+
progress:
|
|
213
|
+
file: "progress.txt"
|
|
214
|
+
archive_threshold: 500
|
|
215
|
+
archive_dir: ".gent/archive"
|
|
216
|
+
|
|
217
|
+
claude:
|
|
218
|
+
permission_mode: "acceptEdits"
|
|
219
|
+
agent_file: "AGENT.md"
|
|
220
|
+
|
|
221
|
+
validation:
|
|
222
|
+
- "npm run typecheck"
|
|
223
|
+
- "npm run lint"
|
|
224
|
+
- "npm run test"
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
### AGENT.md
|
|
228
|
+
|
|
229
|
+
Project-specific instructions for Claude. This file tells Claude how to work with your codebase:
|
|
230
|
+
|
|
231
|
+
- Project overview and architecture
|
|
232
|
+
- Code patterns and conventions
|
|
233
|
+
- Testing requirements
|
|
234
|
+
- Commit conventions
|
|
235
|
+
- Important files to understand
|
|
236
|
+
- Constraints and limitations
|
|
237
|
+
|
|
238
|
+
See [templates/AGENT.md](templates/AGENT.md) for a full example.
|
|
239
|
+
|
|
240
|
+
### progress.txt
|
|
241
|
+
|
|
242
|
+
Append-only log that tracks AI implementation sessions. Each entry includes:
|
|
243
|
+
|
|
244
|
+
- Date and feature description
|
|
245
|
+
- Key implementation decisions
|
|
246
|
+
- Files changed
|
|
247
|
+
- Tests added
|
|
248
|
+
- Concerns for reviewers
|
|
249
|
+
- Commit hash
|
|
250
|
+
|
|
251
|
+
This provides context for future AI sessions and human reviewers.
|
|
252
|
+
|
|
253
|
+
## Workflow
|
|
254
|
+
|
|
255
|
+
```
|
|
256
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
257
|
+
│ GENT WORKFLOW │
|
|
258
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
259
|
+
|
|
260
|
+
┌──────────┐ gent create ┌──────────┐
|
|
261
|
+
│ Idea │ ─────────────────>│ Issue │
|
|
262
|
+
└──────────┘ │ ai-ready │
|
|
263
|
+
└────┬─────┘
|
|
264
|
+
│
|
|
265
|
+
gent run
|
|
266
|
+
│
|
|
267
|
+
v
|
|
268
|
+
┌──────────┐
|
|
269
|
+
│ Branch │
|
|
270
|
+
│ created │
|
|
271
|
+
└────┬─────┘
|
|
272
|
+
│
|
|
273
|
+
Claude implements
|
|
274
|
+
│
|
|
275
|
+
v
|
|
276
|
+
┌──────────┐
|
|
277
|
+
│ Issue │
|
|
278
|
+
│ai-complete│
|
|
279
|
+
└────┬─────┘
|
|
280
|
+
│
|
|
281
|
+
gent pr
|
|
282
|
+
│
|
|
283
|
+
v
|
|
284
|
+
┌──────────┐
|
|
285
|
+
│ PR │
|
|
286
|
+
│ created │
|
|
287
|
+
└────┬─────┘
|
|
288
|
+
│
|
|
289
|
+
Human review + merge
|
|
290
|
+
│
|
|
291
|
+
v
|
|
292
|
+
┌──────────┐
|
|
293
|
+
│ Issue │
|
|
294
|
+
│ closed │
|
|
295
|
+
└──────────┘
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
## Label Conventions
|
|
299
|
+
|
|
300
|
+
### Workflow Status
|
|
301
|
+
|
|
302
|
+
| Label | Description |
|
|
303
|
+
|-------|-------------|
|
|
304
|
+
| `ai-ready` | Issue ready for AI implementation |
|
|
305
|
+
| `ai-in-progress` | AI currently working on this |
|
|
306
|
+
| `ai-completed` | AI done, needs human review |
|
|
307
|
+
| `ai-blocked` | AI couldn't complete, needs help |
|
|
308
|
+
|
|
309
|
+
### Priority (Auto-selection order)
|
|
310
|
+
|
|
311
|
+
| Label | Description |
|
|
312
|
+
|-------|-------------|
|
|
313
|
+
| `priority:critical` | Blocking production |
|
|
314
|
+
| `priority:high` | Important features/bugs |
|
|
315
|
+
| `priority:medium` | Nice-to-have improvements |
|
|
316
|
+
| `priority:low` | Minor tweaks |
|
|
317
|
+
|
|
318
|
+
### Risk (Review depth)
|
|
319
|
+
|
|
320
|
+
| Label | Description |
|
|
321
|
+
|-------|-------------|
|
|
322
|
+
| `risk:low` | UI changes, tests, non-critical |
|
|
323
|
+
| `risk:medium` | API changes, new features |
|
|
324
|
+
| `risk:high` | Migrations, auth, security |
|
|
325
|
+
|
|
326
|
+
### Type (Branch prefix)
|
|
327
|
+
|
|
328
|
+
| Label | Branch Prefix |
|
|
329
|
+
|-------|---------------|
|
|
330
|
+
| `type:feature` | `feature-*` |
|
|
331
|
+
| `type:fix` | `fix-*` |
|
|
332
|
+
| `type:refactor` | `refactor-*` |
|
|
333
|
+
| `type:chore` | `chore-*` |
|
|
334
|
+
| `type:docs` | `docs-*` |
|
|
335
|
+
| `type:test` | `test-*` |
|
|
336
|
+
|
|
337
|
+
## Branch Naming
|
|
338
|
+
|
|
339
|
+
Default pattern: `{author}/{type}-{issue}-{slug}`
|
|
340
|
+
|
|
341
|
+
Examples:
|
|
342
|
+
- `ro/feature-123-add-user-auth`
|
|
343
|
+
- `jd/fix-456-button-alignment`
|
|
344
|
+
- `mb/refactor-789-api-endpoints`
|
|
345
|
+
|
|
346
|
+
The author is derived from:
|
|
347
|
+
1. `GENT_AUTHOR` environment variable (if `author_source: env`)
|
|
348
|
+
2. `git config user.initials` (if set)
|
|
349
|
+
3. Initials from `git config user.name` (e.g., "John Doe" → "jd")
|
|
350
|
+
|
|
351
|
+
## Environment Variables
|
|
352
|
+
|
|
353
|
+
| Variable | Description |
|
|
354
|
+
|----------|-------------|
|
|
355
|
+
| `GENT_AUTHOR` | Override author initials for branch naming |
|
|
356
|
+
| `DEBUG` | Enable debug output |
|
|
357
|
+
|
|
358
|
+
## Tips
|
|
359
|
+
|
|
360
|
+
### Writing Good Descriptions
|
|
361
|
+
|
|
362
|
+
```bash
|
|
363
|
+
# Good - specific and actionable
|
|
364
|
+
gent create "Add password reset functionality with email verification"
|
|
365
|
+
|
|
366
|
+
# Less good - too vague
|
|
367
|
+
gent create "Fix auth"
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
### Customizing for Your Project
|
|
371
|
+
|
|
372
|
+
1. **Edit AGENT.md** with your specific:
|
|
373
|
+
- Architecture patterns
|
|
374
|
+
- Naming conventions
|
|
375
|
+
- Testing requirements
|
|
376
|
+
- Important files
|
|
377
|
+
|
|
378
|
+
2. **Update .gent.yml** with your:
|
|
379
|
+
- Custom area labels
|
|
380
|
+
- Validation commands
|
|
381
|
+
- Branch naming preferences
|
|
382
|
+
|
|
383
|
+
### Handling AI Blocks
|
|
384
|
+
|
|
385
|
+
If Claude gets stuck (`ai-blocked` label):
|
|
386
|
+
1. Check the issue comments for Claude's notes
|
|
387
|
+
2. Add clarifying information to the issue
|
|
388
|
+
3. Reset to `ai-ready` to retry
|
|
389
|
+
4. Or implement manually
|
|
390
|
+
|
|
391
|
+
## Contributing
|
|
392
|
+
|
|
393
|
+
Contributions are welcome! Please read our contributing guidelines before submitting PRs.
|
|
394
|
+
|
|
395
|
+
## License
|
|
396
|
+
|
|
397
|
+
MIT
|