gv-ai 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.
@@ -0,0 +1,10 @@
1
+ {
2
+ "mcpServers": {
3
+ "linear": {
4
+ "command": "bunx",
5
+ "args": [
6
+ "linear-mcp-server"
7
+ ]
8
+ }
9
+ }
10
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "mcpServers": {
3
+ "linear": {
4
+ "command": "bunx",
5
+ "args": [
6
+ "linear-mcp-server"
7
+ ]
8
+ }
9
+ }
10
+ }
package/.mcp.json ADDED
@@ -0,0 +1,10 @@
1
+ {
2
+ "mcpServers": {
3
+ "linear": {
4
+ "command": "bunx",
5
+ "args": [
6
+ "linear-mcp-server"
7
+ ]
8
+ }
9
+ }
10
+ }
package/AGENTS.md ADDED
@@ -0,0 +1,90 @@
1
+ # AGENTS.md
2
+
3
+ ## Linear Ticket Enforcement
4
+
5
+ **CRITICAL**: Before making ANY code changes (editing files, creating files, running commands that modify state), you MUST have a confirmed Linear ticket.
6
+
7
+ ### Pre-Implementation Gate
8
+
9
+ When the user requests implementation work:
10
+
11
+ 1. **Ask what they're working on** (if not clear from context)
12
+ 2. **Search Linear for relevant tickets** using Linear MCP tools
13
+ 3. **Fetch all Linear projects** to show available options
14
+ 4. **Present a numbered list** to the user:
15
+
16
+ ```
17
+ Found potential matches:
18
+ 1. [PROJ-123]: Ticket title here
19
+ 2. [PROJ-456]: Another ticket title
20
+
21
+ Or create new ticket in:
22
+ 3. Backend API (BACK)
23
+ 4. Platform Infrastructure (PLAT)
24
+ 5. Mobile App (MOB)
25
+
26
+ Which one? (enter number)
27
+ ```
28
+
29
+ 5. **Wait for user to select a number**
30
+ 6. **Confirm the selection** before proceeding with any implementation
31
+
32
+ ### Free Actions (No Ticket Required)
33
+
34
+ You may freely help with:
35
+ - Answering questions about code
36
+ - Explaining how code works
37
+ - Discussing approaches and solutions
38
+ - Debugging and analysis (without making changes)
39
+ - Code review and suggestions
40
+ - General brainstorming
41
+
42
+ ### Gated Actions (Ticket Required)
43
+
44
+ You MUST have a confirmed Linear ticket before:
45
+ - Creating new files
46
+ - Editing existing files
47
+ - Running commands that modify state (git commits, npm install, etc.)
48
+ - Creating branches or pull requests
49
+ - Deploying or publishing
50
+
51
+ ### During Implementation
52
+
53
+ Once a ticket is confirmed:
54
+ - Update the Linear ticket with progress comments as you work
55
+ - Set ticket status to "In Progress" when starting
56
+ - Link commits and branches to the ticket
57
+ - Keep the ticket updated with any blockers or decisions
58
+
59
+ ### PR Creation
60
+
61
+ When creating a pull request:
62
+ - Use Linear's branch naming convention (if available)
63
+ - Automatically link the PR to the associated ticket
64
+ - Update the ticket status to "In Review"
65
+ - Add a comment to the ticket with the PR link
66
+
67
+ ### Multi-Ticket Sessions
68
+
69
+ If work touches multiple features or areas:
70
+ - Identify all relevant tickets at the start
71
+ - Confirm with the user which tickets to track
72
+ - Update each ticket appropriately as you work on related code
73
+ - Keep tickets in sync with the work being done
74
+
75
+ ### Ad-hoc Tickets
76
+
77
+ When creating a new ad-hoc ticket:
78
+ - Ask the user which Linear project to create it in
79
+ - Use the user's description as the ticket title
80
+ - Automatically add an "ad-hoc" label
81
+ - Assign the ticket to the current user (if possible)
82
+ - Set the status to "In Progress"
83
+
84
+ ### Important Notes
85
+
86
+ - **Always confirm** before associating work with a ticket
87
+ - **Never guess** which ticket applies - always ask the user
88
+ - **Show ticket details** (title, description preview) when asking for confirmation
89
+ - **Handle errors gracefully** if Linear API is unavailable
90
+ - **Be patient** - the user may need time to find the right ticket
package/README.md ADDED
@@ -0,0 +1,422 @@
1
+ # GV AI - Linear Ticket Enforcement for AI Coding Tools
2
+
3
+ Automate Linear ticket tracking across OpenCode, Claude Code, and Gemini CLI. Never forget to update tickets again!
4
+
5
+ ## Problem
6
+
7
+ Backend developers often get so focused on building that they forget to:
8
+ - Update Linear tasks with progress
9
+ - Link PRs to tickets
10
+ - Create tickets for ad-hoc work
11
+ - Change ticket status
12
+
13
+ This leads to out-of-sync project management and lost context.
14
+
15
+ ## Solution
16
+
17
+ GV AI enforces a simple rule: **No code changes without a Linear ticket.**
18
+
19
+ Your AI coding assistant will:
20
+ 1. Ask which Linear ticket you're working on before making changes
21
+ 2. Show you existing tickets or help create new ones
22
+ 3. Update the ticket automatically as you work
23
+ 4. Link commits and PRs to the ticket
24
+
25
+ ## Features
26
+
27
+ - **Universal**: Works with OpenCode, Claude Code, and Gemini CLI
28
+ - **Project-agnostic**: Works in any repository
29
+ - **Simple setup**: One command to configure everything
30
+ - **Non-intrusive**: Only gates implementation, not conversations
31
+ - **Multi-ticket support**: Track multiple tickets in one session
32
+
33
+ ## Installation
34
+
35
+ ```bash
36
+ bun install -g @gv-org/gv-ai
37
+ ```
38
+
39
+ Or use with bunx:
40
+
41
+ ```bash
42
+ bunx @gv-org/gv-ai project init
43
+ ```
44
+
45
+ ## Quick Start
46
+
47
+ ### 1. Initialize Your Project
48
+
49
+ ```bash
50
+ cd your-project
51
+ gv-ai project init
52
+ ```
53
+
54
+ You'll be prompted to:
55
+ 1. Select which AI tools you use (OpenCode, Claude Code, Gemini CLI, VSCode, Cursor, Windsurf)
56
+
57
+ That's it! The tool will:
58
+ - Configure Linear's remote MCP server for selected tools
59
+ - Create `AGENTS.md` with workflow instructions
60
+ - Create symlinks (`CLAUDE.md`, `GEMINI.md`) if needed
61
+ - Update `.gitignore` to exclude MCP configs
62
+
63
+ ### 2. Authenticate with Linear
64
+
65
+ When you first use Linear in your AI tool, you'll be prompted to authenticate via OAuth. The MCP server will guide you through the process.
66
+
67
+ ### 3. Start Coding
68
+
69
+ Restart your AI coding tool and start a session:
70
+
71
+ ```
72
+ You: Fix the authentication bug in login.ts
73
+
74
+ Agent: Let me search for relevant Linear tickets...
75
+
76
+ Found potential matches:
77
+ 1. BACK-234: Token expiration issues
78
+ 2. BACK-189: Login endpoint returning 401
79
+
80
+ Or create new ticket in:
81
+ 3. Backend API (BACK)
82
+ 4. Platform (PLAT)
83
+
84
+ Which one? (enter number)
85
+
86
+ You: 1
87
+
88
+ Agent: ✓ Working on BACK-234: Token expiration issues
89
+ Let me fix the bug...
90
+ ```
91
+
92
+ ## How It Works
93
+
94
+ ### The Enforcement Gate
95
+
96
+ The agent follows these rules (defined in `AGENTS.md`):
97
+
98
+ **Free actions (no ticket needed):**
99
+ - Answering questions
100
+ - Explaining code
101
+ - Discussing approaches
102
+ - Code review
103
+
104
+ **Gated actions (ticket required):**
105
+ - Creating/editing files
106
+ - Running commands that modify state
107
+ - Creating branches/PRs
108
+
109
+ ### Runtime Flow
110
+
111
+ 1. **User asks to implement something**
112
+ 2. **Agent searches Linear** for relevant tickets using MCP
113
+ 3. **Agent presents options** as a numbered list:
114
+ - Existing tickets that match
115
+ - Options to create new tickets in different projects
116
+ 4. **User selects a number**
117
+ 5. **Agent proceeds** and updates the ticket as it works
118
+
119
+ ### Multi-Ticket Support
120
+
121
+ If your work touches multiple features:
122
+
123
+ ```
124
+ You: Refactor the authentication system
125
+
126
+ Agent: This work touches multiple areas. I found:
127
+ 1. BACK-234: Token expiration (authentication logic)
128
+ 2. BACK-156: Session management (related)
129
+
130
+ Should I track both tickets? Or just one?
131
+
132
+ You: Both
133
+
134
+ Agent: ✓ Tracking BACK-234 and BACK-156
135
+ [proceeds with implementation]
136
+ ```
137
+
138
+ ## Configuration
139
+
140
+ ### File Structure After Init
141
+
142
+ ```
143
+ your-project/
144
+ ├── AGENTS.md # Main instruction file
145
+ ├── CLAUDE.md → AGENTS.md # Symlink (if using Claude Code)
146
+ ├── GEMINI.md → AGENTS.md # Symlink (if using Gemini CLI)
147
+ ├── .mcp.json # Claude Code MCP config
148
+ ├── .gemini/
149
+ │ └── settings.json # Gemini CLI MCP config
150
+ └── opencode.json # OpenCode MCP config
151
+ ```
152
+
153
+ ### MCP Configuration
154
+
155
+ The tool configures the Linear MCP server for each selected tool:
156
+
157
+ **OpenCode** (`opencode.json`):
158
+ ```json
159
+ {
160
+ "mcp": {
161
+ "linear": {
162
+ "type": "local",
163
+ "command": ["npx", "-y", "mcp-remote", "https://mcp.linear.app/sse"],
164
+ "enabled": true
165
+ }
166
+ }
167
+ }
168
+ ```
169
+
170
+ **Claude Code** (`.mcp.json`):
171
+ ```json
172
+ {
173
+ "mcpServers": {
174
+ "linear": {
175
+ "command": "npx",
176
+ "args": ["-y", "mcp-remote", "https://mcp.linear.app/sse"]
177
+ }
178
+ }
179
+ }
180
+ ```
181
+
182
+ **Gemini CLI** (`.gemini/settings.json`):
183
+ ```json
184
+ {
185
+ "mcpServers": {
186
+ "linear": {
187
+ "command": "npx",
188
+ "args": ["-y", "mcp-remote", "https://mcp.linear.app/sse"]
189
+ }
190
+ }
191
+ }
192
+ ```
193
+
194
+ **VSCode** (`.vscode/mcp.json`):
195
+ ```json
196
+ {
197
+ "servers": {
198
+ "linear": {
199
+ "type": "stdio",
200
+ "command": "npx",
201
+ "args": ["-y", "mcp-remote", "https://mcp.linear.app/sse"],
202
+ "auth": {
203
+ "type": "oauth2"
204
+ }
205
+ }
206
+ }
207
+ }
208
+ ```
209
+
210
+ **Cursor** (`.cursor/mcp.json`):
211
+ ```json
212
+ {
213
+ "mcpServers": {
214
+ "linear": {
215
+ "command": "npx",
216
+ "args": ["-y", "mcp-remote", "https://mcp.linear.app/sse"]
217
+ }
218
+ }
219
+ }
220
+ ```
221
+
222
+ **Windsurf** (`~/.codeium/windsurf/mcp_config.json`):
223
+ ```json
224
+ {
225
+ "mcpServers": {
226
+ "linear": {
227
+ "command": "npx",
228
+ "args": ["-y", "mcp-remote", "https://mcp.linear.app/sse"]
229
+ }
230
+ }
231
+ }
232
+ ```
233
+
234
+ ### Customizing AGENTS.md
235
+
236
+ The generated `AGENTS.md` contains the Linear workflow instructions. You can customize:
237
+
238
+ - Which actions require tickets
239
+ - Status transitions (Todo → In Progress → In Review)
240
+ - Branch naming conventions
241
+ - Ad-hoc ticket labels
242
+
243
+ ## Supported AI Tools
244
+
245
+ | Tool | Status | Notes |
246
+ |------|--------|-------|
247
+ | **OpenCode** | ✅ Fully supported | Reads `AGENTS.md` directly |
248
+ | **Claude Code** | ✅ Fully supported | Uses symlink to `CLAUDE.md` |
249
+ | **Gemini CLI** | ✅ Fully supported | Uses symlink to `GEMINI.md` |
250
+ | **VSCode** | ✅ Fully supported | Reads `AGENTS.md` directly |
251
+ | **Cursor** | ✅ Fully supported | Reads `AGENTS.md` directly |
252
+ | **Windsurf** | ✅ Fully supported | Reads `AGENTS.md` directly |
253
+
254
+ ## CLI Commands
255
+
256
+ ```bash
257
+ # Initialize project
258
+ gv-ai project init
259
+
260
+ # Future commands (coming soon)
261
+ gv-ai project status # View current configuration
262
+ gv-ai project add-tool # Add another AI tool
263
+ gv-ai config show # Show current config
264
+ ```
265
+
266
+ ## Technical Details
267
+
268
+ ### Built With
269
+
270
+ - **TypeScript** - Type-safe CLI development
271
+ - **Commander** - CLI framework
272
+ - **Inquirer** - Interactive prompts
273
+ - **Chalk** - Terminal styling
274
+ - **Ora** - Loading spinners
275
+ - **Execa** - Process execution
276
+
277
+ ### Requirements
278
+
279
+ - Node.js 20.0.0 or higher
280
+ - npm or yarn
281
+ - At least one AI coding tool installed (OpenCode, Claude Code, or Gemini CLI)
282
+ - Linear API key
283
+
284
+ ### AGENTS.md Standard
285
+
286
+ This tool follows the [AGENTS.md standard](https://agents.md/), an open format for guiding AI coding agents. AGENTS.md is supported by:
287
+
288
+ - OpenCode
289
+ - Claude Code (via symlink)
290
+ - Gemini CLI (via symlink)
291
+ - Cursor
292
+ - GitHub Copilot
293
+ - Devin
294
+ - Factory
295
+ - And 60,000+ open source projects
296
+
297
+ ### Linear MCP Server
298
+
299
+ Uses the community-built [linear-mcp-server](https://www.npmjs.com/package/linear-mcp-server) which provides:
300
+
301
+ - Issue search and filtering
302
+ - Issue creation and updates
303
+ - Comment management
304
+ - Project and team listing
305
+ - User assignment
306
+
307
+ ## Troubleshooting
308
+
309
+ ### "Tool not found" error
310
+
311
+ Make sure the AI coding tool is installed and available in your PATH:
312
+
313
+ ```bash
314
+ # Check if tools are installed
315
+ opencode --version
316
+ claude --version
317
+ gemini --version
318
+ ```
319
+
320
+ ### MCP not working
321
+
322
+ 1. **Restart your AI tool** - MCP configs are loaded at startup
323
+ 2. **Check your Linear API key** - Test it at [linear.app/settings/api](https://linear.app/settings/api)
324
+ 3. **Verify MCP config files** - Make sure they were created in the right location
325
+
326
+ ### Agent not enforcing tickets
327
+
328
+ 1. **Check AGENTS.md exists** - The agent needs this file to know the rules
329
+ 2. **Verify symlinks** - Claude Code and Gemini CLI need `CLAUDE.md`/`GEMINI.md` symlinks
330
+ 3. **Restart your session** - Some tools need a fresh session to reload instructions
331
+
332
+ ## Examples
333
+
334
+ ### Example 1: Bug Fix
335
+
336
+ ```
337
+ You: The user profile page is crashing when email is null
338
+
339
+ Agent: Let me search Linear...
340
+
341
+ Found: FRONT-89: Profile page crashes with null email
342
+
343
+ Is this the ticket? (yes/no)
344
+
345
+ You: yes
346
+
347
+ Agent: ✓ Working on FRONT-89
348
+ [analyzes code, finds bug, implements fix]
349
+
350
+ I've fixed the null check in ProfilePage.tsx
351
+ Updated FRONT-89 with the solution
352
+ ```
353
+
354
+ ### Example 2: New Feature
355
+
356
+ ```
357
+ You: Add dark mode toggle to settings
358
+
359
+ Agent: No existing ticket found. Create new ticket in:
360
+ 1. Frontend (FRONT)
361
+ 2. Design System (DS)
362
+
363
+ Which project? (enter number)
364
+
365
+ You: 1
366
+
367
+ Agent: ✓ Created FRONT-234: Add dark mode toggle to settings (ad-hoc)
368
+ ✓ Set status to "In Progress"
369
+
370
+ [proceeds with implementation]
371
+ ```
372
+
373
+ ### Example 3: Refactoring
374
+
375
+ ```
376
+ You: Refactor the auth system to use JWT instead of sessions
377
+
378
+ Agent: This affects multiple areas. Found:
379
+ 1. BACK-156: Migrate to JWT authentication
380
+ 2. BACK-189: Remove session storage
381
+
382
+ Work on both tickets?
383
+
384
+ You: yes
385
+
386
+ Agent: ✓ Tracking BACK-156 and BACK-189
387
+ [proceeds with refactoring both areas]
388
+ ```
389
+
390
+ ## Roadmap
391
+
392
+ - [ ] Support for GitHub integration
393
+ - [ ] Automatic PR creation with ticket linking
394
+ - [ ] Status auto-transitions based on git events
395
+ - [ ] Team-wide configuration templates
396
+ - [ ] Analytics dashboard for ticket tracking
397
+ - [ ] Slack notifications for ticket updates
398
+
399
+ ## Contributing
400
+
401
+ This is an internal tool for GV team. For issues or suggestions, reach out to the platform team.
402
+
403
+ ## License
404
+
405
+ MIT
406
+
407
+ ## Credits
408
+
409
+ Built with:
410
+ - [AGENTS.md Standard](https://agents.md/) - Open format for AI agents
411
+ - [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) - Standard for connecting AI to data sources
412
+ - [Linear MCP Server](https://www.npmjs.com/package/linear-mcp-server) - Community-built Linear integration
413
+ - [Commander.js](https://github.com/tj/commander.js) - CLI framework
414
+ - [Inquirer](https://github.com/SBoudrias/Inquirer.js) - Interactive prompts
415
+
416
+ ## Sources
417
+
418
+ - [AGENTS.md GitHub Repository](https://github.com/agentsmd/agents.md)
419
+ - [AGENTS.md Official Website](https://agents.md/)
420
+ - [Linux Foundation - Agentic AI Foundation Announcement](https://www.linuxfoundation.org/press/linux-foundation-announces-the-formation-of-the-agentic-ai-foundation)
421
+ - [Linear MCP Server npm package](https://www.npmjs.com/package/linear-mcp-server)
422
+ - [Node.js CLI Best Practices](https://github.com/lirantal/nodejs-cli-apps-best-practices)