@bridge_gpt/mcp-server 0.1.8 → 0.1.9

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 CHANGED
@@ -10,7 +10,7 @@ From your **project root**, install the MCP server and scaffold slash commands:
10
10
 
11
11
  ```bash
12
12
  npm i @bridge_gpt/mcp-server
13
- npx @bridge_gpt/mcp-server --init
13
+ npx -y @bridge_gpt/mcp-server --init
14
14
  ```
15
15
 
16
16
  `--init` must be run from the directory containing your `package.json`. It:
@@ -36,6 +36,8 @@ Add the following to your editor's MCP configuration file, pasting in the API ke
36
36
  <details>
37
37
  <summary><strong>Claude Code (.mcp.json)</strong></summary>
38
38
 
39
+ The `--init` command (step 1) detects Claude Code and creates a `.mcp.json` at your project root with placeholder values. Open it and replace `your-repo` and `your-api-key` with your actual values from step 2:
40
+
39
41
  ```json
40
42
  {
41
43
  "mcpServers": {
@@ -52,16 +54,6 @@ Add the following to your editor's MCP configuration file, pasting in the API ke
52
54
  }
53
55
  }
54
56
  ```
55
-
56
- Or via CLI:
57
-
58
- ```bash
59
- claude mcp add bridge-api -- npx -y @bridge_gpt/mcp-server \
60
- --env BAPI_BASE_URL=https://bridgegpt-api.com \
61
- --env BAPI_REPO_NAME=your-repo \
62
- --env BAPI_API_KEY=your-api-key \
63
- --env BAPI_DOCS_DIR=docs/tmp
64
- ```
65
57
  </details>
66
58
 
67
59
  <details>
@@ -157,70 +149,171 @@ If you're the first person to install Bridge API on your project, run the `/lear
157
149
 
158
150
  You only need to do this once per project — the learned standards persist for all team members.
159
151
 
160
- ## Commands & Pipelines
152
+ ## Pipelines
153
+
154
+ Pipelines are declarative, multi-step workflows that your AI agent executes step-by-step. Each pipeline is a JSON recipe that chains MCP tool calls and free-form agent tasks, with variable substitution, per-step error handling, and optional approval gates. Bridge ships with built-in pipelines; you can also write your own (see [Custom Pipelines](#custom-pipelines)).
155
+
156
+ | Pipeline | Description | Invoke with |
157
+ |---|---|---|
158
+ | `implement-ticket` | Generate a plan, execute the implementation, commit, open a PR, and monitor CI | `/implement-ticket PROJ-123` |
159
+ | `review-ticket` | Two-round ticket quality review: clarifying questions and critique from multiple providers | `/review-ticket PROJ-123` |
160
+ | `learn-repository` | Analyze codebase architecture, testing patterns, review standards, and documentation conventions, then upload to Bridge | `/learn-repository` |
161
+ | `pr-ticket` | Commit changes and open a pull request | `/create-pr PROJ-123` |
162
+ | `check-ci-ticket` | Commit, open a PR, then monitor CI checks until they pass or fail | `/check-ci PROJ-123` |
163
+
164
+ ## Commands
161
165
 
162
- Slash commands are available after running `--init`. Invoke them from your AI assistant's chat.
166
+ Commands are slash commands you invoke from your AI assistant's chat. Most orchestrate multi-step workflows; some are simple single-action utilities. Run `--init` to scaffold them into your project.
163
167
 
164
168
  | Command | Description |
165
169
  |---|---|
166
- | `/explore-ticket` | Free-form codebase exploration searches code, runs research, writes analysis with implementation options |
167
- | `/review-ticket PROJ-123` | Two-round ticket quality review with clarifying questions and critiques from multiple LLM providers |
168
- | `/implement-ticket PROJ-123` | End-to-end implementation generates a plan, executes it, commits, opens a PR, monitors CI |
169
- | `/learn-repository` | Teaches Bridge API about your codebase by analyzing architecture, testing, and review patterns |
170
+ | `/check-ci [PROJ-123]` | Monitor CI checks for the current branch, triage failures, apply fixes, and report results |
171
+ | `/check-parse-status` | Check whether a background repository parse job is still running |
172
+ | `/clarify-ticket PROJ-123` | Generate clarifying questions for a ticket and save them locally |
173
+ | `/code-ticket PROJ-123` | Download the implementation plan and questions, then execute the plan inline |
174
+ | `/commit-ticket PROJ-123` | Stage, commit, and push changes; transition Jira status; post a smoke-test comment |
175
+ | `/create-pr PROJ-123` | Commit staged changes and open a pull request |
176
+ | `/critique-ticket PROJ-123` | Generate a ticket quality critique and save it locally |
177
+ | `/explore-ticket [PROJ-123]` | Free-form codebase exploration — searches code, surfaces implementation options and questions |
178
+ | `/implement-ticket PROJ-123` | Full end-to-end implementation: plan → code → commit → PR → CI |
179
+ | `/learn-repository` | Teach Bridge API about your codebase (architecture, testing, review patterns) |
180
+ | `/parse-repository` | Queue a background job to index the repository for Bridge AI agents |
181
+ | `/plan-ticket PROJ-123` | Generate an AI implementation plan and save it locally |
182
+ | `/reimplement-ticket PROJ-123` | Follow-up implementation pass using previous implementation context |
183
+ | `/review-ticket PROJ-123` | Two-round ticket quality review with critiques from multiple LLM providers |
184
+ | `/run-tests` | Run the full test suite, triage failures, and classify issues as test bugs vs. implementation bugs |
185
+ | `/scan-tickets` | Sync recently-updated Jira tickets and backfill workflow timestamps |
186
+ | `/teach-bridge` | Update a Bridge API configuration field via natural-language instructions |
187
+ | `/update-ticket PROJ-123` | Fetch clarifying questions and critique, then rewrite the ticket description and push to Jira |
188
+ | `/write-ticket` | Draft a new Jira ticket from a prompt and upload it |
189
+
190
+ > Commands are designed for Claude Code. Other editors may support slash commands differently — check your editor's documentation for how to invoke prompt files.
170
191
 
171
192
  ## Available Tools
172
193
 
194
+ MCP tools are the low-level primitives Bridge exposes to your AI assistant. You don't call them directly — ask your AI assistant to perform the task you need, or compose them into a custom pipeline.
195
+
196
+ ### Connectivity
197
+
198
+ | Tool | Description |
199
+ |---|---|
200
+ | `ping` | Verify connectivity and confirm your API key is valid |
201
+
202
+ ### Jira Tickets
203
+
173
204
  | Tool | Description |
174
205
  |---|---|
175
- | `ping` | Health check verify connectivity and API key |
176
- | `get_project_standards` | Retrieve configured coding standards |
177
- | `get_tickets` | Search and list Jira tickets |
206
+ | `get_tickets` | Search and list Jira tickets by query, status, or date |
178
207
  | `get_ticket` | Get full details for a single ticket |
179
208
  | `create_ticket` | Create a new Jira ticket |
180
- | `add_comment` | Add a comment to a ticket |
209
+ | `add_comment` | Post a comment on a ticket |
181
210
  | `update_ticket_description` | Replace a ticket's description |
182
- | `upload_attachment` | Upload a file as an attachment to a Jira ticket |
183
- | `request_plan_generation` | Generate an AI implementation plan (async) |
211
+ | `upload_attachment` | Upload a file as a ticket attachment |
212
+
213
+ ### AI Generation
214
+
215
+ Async tools follow a request/get pattern: call the `request_*` tool to kick off generation, then call the matching `get_*` tool to retrieve the result (or pass `wait_for_result: true` to poll automatically).
216
+
217
+ | Tool | Description |
218
+ |---|---|
219
+ | `request_plan_generation` | Request an AI-generated implementation plan |
184
220
  | `get_plan` | Retrieve a generated implementation plan |
185
- | `request_architecture` | Generate an AI architecture plan (async) |
221
+ | `request_architecture` | Request an AI-generated architecture plan |
186
222
  | `get_architecture` | Retrieve a generated architecture plan |
187
- | `request_clarifying_questions` | Generate clarifying questions for a ticket (async) |
223
+ | `request_clarifying_questions` | Request clarifying questions for a ticket |
188
224
  | `get_clarifying_questions` | Retrieve generated clarifying questions |
189
- | `request_ticket_critique` | Generate a ticket quality critique (async) |
225
+ | `request_ticket_critique` | Request a ticket quality critique |
190
226
  | `get_ticket_critique` | Retrieve a generated ticket critique |
191
- | `request_reimplement_context` | Request reimplementation context (async) |
192
- | `get_reimplement_context` | Retrieve reimplementation context |
193
- | `request_deep_research` | Run deep research on a query (async) |
227
+ | `request_reimplement_context` | Request context assembly for a follow-up implementation |
228
+ | `get_reimplement_context` | Retrieve assembled reimplementation context |
229
+ | `request_deep_research` | Submit a deep research query |
194
230
  | `get_deep_research` | Retrieve deep research results |
195
- | `parse_repository` | Parse and index a repository (async) |
196
- | `get_parse_status` | Check repository parse status |
197
- | `regenerate_directory_map` | Regenerate the repository directory map |
231
+
232
+ ### Ticket Lifecycle
233
+
234
+ | Tool | Description |
235
+ |---|---|
198
236
  | `track_ticket` | Register a ticket for lifecycle tracking |
199
- | `update_ticket_state` | Update ticket lifecycle timestamps |
200
- | `get_ticket_state` | Get ticket tracking state and timestamps |
201
- | `list_config_fields` | List available configuration fields |
202
- | `get_config_field` | Get a configuration field value |
203
- | `update_config_field` | Update a configuration field |
204
- | `get_my_role` | Check role and permissions for the current API key |
205
- | `get_jira_transitions` | List available Jira status transitions |
206
- | `update_jira_status` | Transition a ticket to a new status |
237
+ | `update_ticket_state` | Update workflow timestamps for a tracked ticket |
238
+ | `get_ticket_state` | Get workflow state and timestamps for a tracked ticket |
239
+
240
+ ### Jira Status
241
+
242
+ | Tool | Description |
243
+ |---|---|
244
+ | `get_jira_transitions` | List available status transitions for a ticket |
245
+ | `update_jira_status` | Transition a ticket to a new Jira status |
207
246
  | `resolve_target_status` | Resolve the post-PR target status for a project |
208
- | `create_pull_request` | Create a pull request |
209
- | `resolve_ci_checks` | Discover and classify CI checks |
210
- | `poll_ci_checks` | Poll CI check status |
211
- | `get_docs_dir` | Return the configured docs directory path |
212
- | `list_pipelines` | List available pipeline recipes |
213
- | `get_pipeline_recipe` | Retrieve a resolved pipeline recipe |
247
+
248
+ ### Configuration
249
+
250
+ | Tool | Description |
251
+ |---|---|
252
+ | `get_project_standards` | Retrieve configured coding standards and architecture guidelines |
253
+ | `list_config_fields` | List all available configuration fields |
254
+ | `get_config_field` | Read the current value of a configuration field |
255
+ | `update_config_field` | Update a configuration field |
256
+ | `get_my_role` | Check the role and permissions for the current API key |
257
+
258
+ ### Repository & CI
259
+
260
+ | Tool | Description |
261
+ |---|---|
262
+ | `parse_repository` | Queue a background job to parse and index the repository |
263
+ | `get_parse_status` | Check whether a repository parse is in progress |
264
+ | `regenerate_directory_map` | Regenerate the repository directory map |
265
+ | `create_pull_request` | Create a pull request on GitHub or Bitbucket |
266
+ | `resolve_ci_checks` | Discover and classify CI checks for a commit |
267
+ | `poll_ci_checks` | Poll the current status of CI checks |
268
+
269
+ ### Pipelines
270
+
271
+ | Tool | Description |
272
+ |---|---|
273
+ | `get_docs_dir` | Return the configured local docs directory path |
274
+ | `list_pipelines` | List available pipeline recipes with names and descriptions |
275
+ | `get_pipeline_recipe` | Retrieve a fully resolved pipeline recipe with variables substituted |
214
276
 
215
277
  ## Custom Pipelines
216
278
 
217
- You can create your own pipelines by placing JSON files in `.bridge/pipelines/` (or the directory specified by `BAPI_PIPELINES_DIR`). Custom pipelines are loaded at server startup and appear alongside bundled pipelines in `list_pipelines`.
279
+ You can create your own pipelines by adding JSON files to `.bridge/pipelines/`. Running `--init` scaffolds this directory with a `README.md` and an example pipeline to get you started.
280
+
281
+ The easiest way to write a custom pipeline is to describe what you want to automate to your AI coding agent and have it draft the JSON for you. The schema is straightforward, and agents like Claude Code understand it well — just describe the steps you want, and the agent will produce a working pipeline file.
282
+
283
+ **What you can build:**
284
+
285
+ - Any sequence of Bridge MCP tool calls and free-form agent tasks
286
+ - Parameterized workflows using variables (e.g., `{ticket_key}`)
287
+ - Approval gates that pause for user confirmation before sensitive steps
288
+ - Per-step error handling — halt immediately or warn and continue
289
+
290
+ **Ideas for custom pipelines:**
291
+
292
+ - A standup pipeline that fetches your open tickets and summarizes their status
293
+ - A ticket triage pipeline that runs critiques on a batch of new tickets
294
+ - A pre-merge checklist that runs tests, checks linting, and posts a summary comment
218
295
 
219
- 1. Run `npx @bridge_gpt/mcp-server --init` to scaffold the directory structure with a README and example pipeline.
220
- 2. Add pipeline JSON files to `.bridge/pipelines/`.
221
- 3. Optionally add instruction markdown files to `.bridge/instructions/` and reference them via `instruction_file` in your pipeline steps.
296
+ **Step types:**
222
297
 
223
- If a custom pipeline has the same key as a bundled pipeline, it overrides the bundled one (a warning is logged at startup).
298
+ | Type | What it does |
299
+ |---|---|
300
+ | `mcp_call` | Calls an MCP tool with the given params |
301
+ | `agent_task` | Gives the AI a free-form instruction (inline or from a file in `.bridge/instructions/`) |
302
+
303
+ Variables are declared in the `variables` array and referenced as `{variable_name}` in params and instructions. Each step supports `on_error: "halt"` (default) or `"warn_and_continue"`, and `requires_approval: true` to pause before execution.
304
+
305
+ **System variables:**
306
+
307
+ Two variables are automatically available in every pipeline without declaring them:
308
+
309
+ | Variable | What it does |
310
+ |---|---|
311
+ | `{provider}` | Routes AI generation to a specific LLM provider (`openai`, `anthropic`, or `gemini`). Pass it through to any `request_*` tool param to control which provider handles that step. Omit it (or leave it empty) to use the project default. |
312
+ | `{second_opinion}` | Runs AI generation through a different provider than the default, acting as a cross-check. Set to `"auto"` to let Bridge pick the second provider automatically. When set, it takes precedence over `{provider}`. Use this when you want two independent AI perspectives on the same task — for example, running clarifying questions and a critique twice (once with each provider) produces better results than a single pass. |
313
+
314
+ See `.bridge/pipelines/README.md` for the full schema reference.
315
+
316
+ If a custom pipeline has the same key as a built-in pipeline, the custom version takes precedence (a warning is logged at startup).
224
317
 
225
318
  ## Environment Variables
226
319
 
@@ -232,19 +325,3 @@ If a custom pipeline has the same key as a bundled pipeline, it overrides the bu
232
325
  | `BAPI_PROJECT_ROOT` | No | _(auto-set by --init)_ | Absolute path to project root. Anchors `BAPI_DOCS_DIR` and `BAPI_PIPELINES_DIR` resolution |
233
326
  | `BAPI_DOCS_DIR` | No | `docs/tmp` | Local directory for saving plans, critiques, and research reports |
234
327
  | `BAPI_PIPELINES_DIR` | No | `.bridge/pipelines` | Directory for user-defined custom pipeline JSON files |
235
-
236
- ## Publishing
237
-
238
- This package uses tag-based publishing. To release a new version:
239
-
240
- ```bash
241
- cd mcp_server
242
- npm version patch # creates tag mcp-server/v0.1.x
243
- git push --follow-tags
244
- ```
245
-
246
- The GitHub Actions workflow triggers on `mcp-server/v*` tags and publishes to npm with provenance.
247
-
248
- ## License
249
-
250
- MIT
@@ -0,0 +1,110 @@
1
+ /**
2
+ * Agent utility functions for reconstructing and translating agent definitions
3
+ * across different IDE platforms.
4
+ */
5
+ // Deterministic key order: known fields first, then remaining sorted alphabetically
6
+ const SCHEMA_KEY_ORDER = ["name", "description", "model", "tools"];
7
+ // Claude Code-specific fields that have no Copilot equivalent
8
+ const COPILOT_STRIPPED_FIELDS = new Set([
9
+ "memory", "hooks", "permissionMode", "skills", "isolation",
10
+ "maxTurns", "color", "effort", "background", "disallowedTools",
11
+ ]);
12
+ // Characters that require YAML quoting
13
+ const YAML_SPECIAL = /[:#{}[\]\n"'|>@`!&*?,]/;
14
+ function quoteYamlValue(value) {
15
+ if (YAML_SPECIAL.test(value)) {
16
+ return JSON.stringify(value);
17
+ }
18
+ return value;
19
+ }
20
+ function orderedKeys(frontmatter) {
21
+ const keys = Object.keys(frontmatter);
22
+ const ordered = [];
23
+ // Add schema-ordered keys first (if present)
24
+ for (const key of SCHEMA_KEY_ORDER) {
25
+ if (keys.includes(key))
26
+ ordered.push(key);
27
+ }
28
+ // Add remaining keys sorted alphabetically
29
+ const remaining = keys.filter(k => !SCHEMA_KEY_ORDER.includes(k)).sort();
30
+ ordered.push(...remaining);
31
+ return ordered;
32
+ }
33
+ function serializeFrontmatter(frontmatter, keys) {
34
+ const lines = [];
35
+ for (const key of keys) {
36
+ const value = frontmatter[key];
37
+ if (typeof value === "string") {
38
+ lines.push(`${key}: ${quoteYamlValue(value)}`);
39
+ }
40
+ else if (typeof value === "boolean" || typeof value === "number") {
41
+ lines.push(`${key}: ${value}`);
42
+ }
43
+ else {
44
+ // Arrays or objects — use JSON.stringify for safety
45
+ lines.push(`${key}: ${JSON.stringify(value)}`);
46
+ }
47
+ }
48
+ return lines.join("\n");
49
+ }
50
+ /**
51
+ * Reconstruct a Claude Code-native agent markdown file from parsed frontmatter and body.
52
+ */
53
+ export function reconstructAgentMarkdown(frontmatter, body) {
54
+ const keys = orderedKeys(frontmatter);
55
+ const yaml = serializeFrontmatter(frontmatter, keys);
56
+ return `---\n${yaml}\n---\n${body}`;
57
+ }
58
+ /**
59
+ * Translate a Claude Code agent definition into GitHub Copilot .agent.md format.
60
+ *
61
+ * - model: always set to "Auto" (Copilot doesn't support shorthands)
62
+ * - mcpServers -> mcp-servers
63
+ * - tools: comma-separated string -> YAML block array
64
+ * - Claude Code-specific fields are stripped
65
+ */
66
+ export function translateAgentToCopilot(frontmatter, body) {
67
+ const translated = {};
68
+ for (const [key, value] of Object.entries(frontmatter)) {
69
+ // Strip Claude Code-specific fields
70
+ if (COPILOT_STRIPPED_FIELDS.has(key))
71
+ continue;
72
+ if (key === "model") {
73
+ translated["model"] = "Auto";
74
+ }
75
+ else if (key === "mcpServers") {
76
+ translated["mcp-servers"] = value;
77
+ }
78
+ else if (key === "tools" && typeof value === "string") {
79
+ // Convert comma-separated tools to array for YAML block format
80
+ translated["tools"] = value.split(",").map(t => t.trim()).filter(Boolean);
81
+ }
82
+ else {
83
+ translated[key] = value;
84
+ }
85
+ }
86
+ // Build frontmatter with deterministic key ordering
87
+ const keys = orderedKeys(translated);
88
+ const lines = [];
89
+ for (const key of keys) {
90
+ const value = translated[key];
91
+ if (Array.isArray(value)) {
92
+ // YAML block array format
93
+ lines.push(`${key}:`);
94
+ for (const item of value) {
95
+ lines.push(` - ${quoteYamlValue(String(item))}`);
96
+ }
97
+ }
98
+ else if (typeof value === "string") {
99
+ lines.push(`${key}: ${quoteYamlValue(value)}`);
100
+ }
101
+ else if (typeof value === "boolean" || typeof value === "number") {
102
+ lines.push(`${key}: ${value}`);
103
+ }
104
+ else {
105
+ lines.push(`${key}: ${JSON.stringify(value)}`);
106
+ }
107
+ }
108
+ const yaml = lines.join("\n");
109
+ return `---\n${yaml}\n---\n${body}`;
110
+ }
@@ -0,0 +1,13 @@
1
+ // AUTO-GENERATED — do not edit manually. Regenerate with: npm run build
2
+ // This file is produced by scripts/bundle-agents.js
3
+ export const AGENTS = {
4
+ "jira-ticket-writer": {
5
+ "frontmatter": {
6
+ "name": "jira-ticket-writer",
7
+ "description": "Use this agent when the user describes a problem, feature request, bug, or improvement and wants a structured Jira ticket written as a markdown file. This agent performs deep codebase research before writing the ticket to ensure requirements reference existing code, patterns, and extension points.\\n\\nExamples:\\n\\n<example>\\nContext: The user describes a feature they want to add to the project.\\nuser: \"We need to add rate limiting to our LLM integration so we don't exceed provider quotas\"\\nassistant: \"I'll use the Task tool to launch the jira-ticket-writer agent to research the codebase and create a structured Jira ticket for this feature.\"\\n<commentary>\\nSince the user is describing a problem/feature that needs a Jira ticket, use the jira-ticket-writer agent to research the codebase thoroughly and produce a well-structured ticket with code references.\\n</commentary>\\n</example>\\n\\n<example>\\nContext: The user wants a ticket for a bug fix.\\nuser: \"There's an issue where custom object iterators aren't being closed properly in some of our job scripts, can you write a ticket for that?\"\\nassistant: \"I'll use the Task tool to launch the jira-ticket-writer agent to investigate which job scripts have this issue and create a detailed Jira ticket.\"\\n<commentary>\\nThe user explicitly wants a Jira ticket written. Use the jira-ticket-writer agent so it can scan the relevant job scripts, identify the specific files and functions affected, and produce a ticket with precise code references.\\n</commentary>\\n</example>\\n\\n<example>\\nContext: The user describes an improvement they want.\\nuser: \"We should add support for a new LLM provider - Mistral - to our integration cartridge\"\\nassistant: \"Let me use the Task tool to launch the jira-ticket-writer agent to research the existing LLM integration architecture and write a comprehensive Jira ticket for adding Mistral support.\"\\n<commentary>\\nThe user wants a new feature added. The jira-ticket-writer agent will research the existing LLM client architecture, provider patterns, service definitions, and normalization helpers to write a ticket that references all the specific files and patterns that need to be extended.\\n</commentary>\\n</example>",
8
+ "model": "opus",
9
+ "color": "blue"
10
+ },
11
+ "body": "\nYou are an elite software engineering project manager and technical analyst with deep expertise in codebase archaeology and Jira ticket crafting. You excel at understanding complex codebases, identifying relevant existing code, and translating problem descriptions into precisely-scoped, actionable Jira tickets that engineers can pick up and execute with minimal ambiguity.\n\n## Your Mission\n\nGiven a problem description from the user, you will:\n1. Conduct thorough codebase research to understand the existing architecture, patterns, and relevant code\n2. Write a structured Jira ticket as a new markdown file that references specific files, functions, and patterns from the codebase\n\n## Phase 1: Deep Codebase Research\n\nThis is the most critical phase. You MUST spend significant time here before writing anything. Do NOT rush this phase.\n\n### Research Protocol\n\n1. **Understand the Problem Space**: Re-read the user's problem description carefully. Identify the domain, the affected areas, and the type of change needed (new feature, bug fix, refactor, enhancement).\n\n2. **Map the Relevant Architecture**: \n - Search for files, modules, and directories related to the problem domain\n - Read the key source files thoroughly — do not skim\n - Trace code paths: how does data flow through the relevant parts of the system?\n - Identify controller -> helper -> service -> model chains if applicable\n\n3. **Identify Extension Points**:\n - What existing code can be reused or extended?\n - What patterns does the codebase already use for similar functionality?\n - Are there helper functions, utilities, or base classes that should be leveraged?\n - Are there configuration files, metadata definitions, or templates that need modification?\n\n4. **Identify Constraints**:\n - What conventions does the project follow? (Check CLAUDE.md, README, existing patterns)\n - What testing patterns are used?\n - Are there ES5 limitations, specific framework patterns, or platform constraints?\n\n5. **Catalog Your Findings**: Keep mental notes of every relevant file path, function name, pattern, and architectural decision you discover. You will reference these in the ticket.\n\n### Research Depth Guidelines\n- Read at least 5-15 relevant source files in full, more if the problem is complex\n- Follow import chains to understand dependencies\n- Check test files to understand expected behaviors and testing patterns\n- Review configuration and metadata files if relevant\n- Search for TODO comments, known limitations, or related existing issues in the code\n\n## Phase 2: Write the Jira Ticket\n\nAfter completing research, create a new markdown file with the ticket. Use the naming convention `tickets/TICKET-<short-descriptive-name>.md`. If the `tickets/` directory does not exist, create it.\n\n### Ticket Structure\n\nThe markdown file MUST contain exactly these sections:\n\n```markdown\n# [Concise Title Describing the Task]\n\n## Summary\n\n[2-4 sentences describing what this task is about, why it matters, and the high-level approach. Be specific — reference the actual system components involved.]\n\n## Requirements\n\n[Numbered list of specific, actionable requirements. Each requirement should be a clear unit of work.]\n\n1. **[Requirement Title]**: [Description of what needs to be done.]\n - *Relevant code*: `path/to/file.js` — `functionName()` [brief note on how this code relates]\n - *Relevant code*: `path/to/other/file.js` — [brief note]\n\n2. **[Requirement Title]**: [Description]\n - *Relevant code*: ...\n\n[Continue for all requirements]\n\n## Acceptance Criteria\n\n[Checklist format using markdown checkboxes. Each criterion is a testable, verifiable condition.]\n\n- [ ] [Specific, testable criterion]\n- [ ] [Another criterion]\n- [ ] [Continue as needed]\n```\n\n### Writing Guidelines\n\n**Summary**:\n- Be concrete, not abstract. Name the actual components, cartridges, or subsystems involved.\n- State the \"why\" — what problem does this solve or what value does it add?\n- Mention the general technical approach if it's clear from the research.\n\n**Requirements**:\n- Each requirement should represent a logical unit of work\n- Order requirements in a logical implementation sequence when possible\n- ALWAYS cite relevant existing files and functions when they exist. Use exact file paths relative to the project root.\n- Explain HOW the existing code relates: \"extend this function\", \"follow this pattern\", \"reuse this helper\", \"modify this configuration\"\n- If a requirement involves creating new files, suggest where they should live based on existing project structure conventions\n- Be specific about what needs to change vs. what needs to be created new\n- Include requirements for tests, documentation, and configuration/metadata changes if applicable\n\n**Acceptance Criteria**:\n- Every criterion must be independently verifiable\n- Cover functional requirements, edge cases, testing, and non-functional requirements\n- Include criteria for backwards compatibility if relevant\n- Include criteria for test coverage\n- Use checkbox format (`- [ ]`) so engineers can track progress\n\n## Quality Standards\n\n- **No vague language**: Replace \"should handle errors properly\" with \"should catch LLM provider timeouts and return a normalized error response with errorType 'TimeoutError'\"\n- **No assumptions without evidence**: Only reference code you actually read during research. If you're unsure about something, say so explicitly in the ticket.\n- **Appropriate scope**: The ticket should represent a coherent, deliverable unit of work. If the problem is too large, note that it may need to be broken into sub-tasks, but still write the parent ticket.\n- **Developer empathy**: Write as if the developer picking this up has general project knowledge but hasn't recently worked on this specific area. Give them enough context to get started quickly.\n\n## Important Reminders\n\n- Do NOT skip or abbreviate the research phase. The quality of the ticket depends entirely on the depth of your codebase understanding.\n- Do NOT make up file paths or function names. Only reference code you have actually found and read.\n- DO create the markdown file — do not just output the content to the chat. Write it to disk.\n- If the project has specific conventions (from CLAUDE.md or similar), ensure your ticket's requirements align with those conventions.\n"
12
+ }
13
+ };