@konductro/codex-plugin 2.0.1 → 2.1.1

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
@@ -67,6 +67,7 @@ Skills are guided, multi-step workflows invoked by asking Codex naturally:
67
67
  | `konductro-find-prototype` | Find and download approved UX prototypes for the current project |
68
68
  | `konductro-profile-repository` | Scan the current repo and submit its profile to Konductro |
69
69
  | `konductro-start-ticket` | Pick up an assigned ticket and start work |
70
+ | `konductro-bug-enrich` | Enrich a bug ticket with technical analysis — explores codebase and submits structured context |
70
71
 
71
72
  ## Tools
72
73
 
@@ -114,6 +115,8 @@ Tools are called automatically by Codex based on natural language. You do not in
114
115
  | Tool | What it does |
115
116
  |---|---|
116
117
  | `profile_repository` | Submit a repository profile: tech stack, APIs, dependencies, and events |
118
+ | `get_bug_for_enrichment` | Load a bug ticket and project context for enrichment |
119
+ | `submit_bug_enrichment` | Submit structured technical enrichment for a bug ticket |
117
120
 
118
121
  ## Updating
119
122
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@konductro/codex-plugin",
3
- "version": "2.0.1",
3
+ "version": "2.1.1",
4
4
  "description": "Codex plugin for the Konductro platform: technical analysis, delivery tasks, repository profiling, and prototype workflows.",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
@@ -314,7 +314,7 @@ server.tool(
314
314
  title: z.string().describe('Task title'),
315
315
  description: z.string().describe('Technical description of the task'),
316
316
  repositoryId: z.string().describe('Repository ID from the context'),
317
- type: z.enum(['ui_component', 'api_java', 'api_node', 'android', 'ios', 'infra']).default('api_node').describe('Task type'),
317
+ type: z.string().trim().max(24).optional().describe('Short free-text tech tag derived from the repo stack (e.g. C#, PHP, Node, Java, UI, Infra); one token, max 24 chars, no fixed list'),
318
318
  acceptanceCriteria: z.array(z.string()).default([]).describe('Technical acceptance criteria'),
319
319
  architecturalNotes: z.array(z.string()).default([]).describe('Implementation notes for the agent'),
320
320
  componentPath: z.string().optional().nullable().describe('Primary file/directory path for this task'),
@@ -899,6 +899,87 @@ server.tool(
899
899
  }
900
900
  );
901
901
 
902
+ // Tool: Get bug context for enrichment
903
+ server.tool(
904
+ 'get_bug_for_enrichment',
905
+ 'Load a bug ticket and its project context for enrichment. Returns the bug description, acceptance criteria, project name, and existing notes.',
906
+ {
907
+ ticketId: z.string().describe('The ticket ID or key (e.g. KON-42) of the bug to enrich'),
908
+ },
909
+ async ({ ticketId }) => {
910
+ try {
911
+ const ctx = await konductroFetch(`/api/cli/bugs/${encodeURIComponent(ticketId)}/context`);
912
+
913
+ let text = `## Bug Context\n\n`;
914
+ text += `**Ticket:** ${ctx.key} — ${ctx.title}\n`;
915
+ text += `**Project:** ${ctx.projectName ?? 'Unknown'}\n`;
916
+ text += `**Phase:** ${ctx.phaseName ?? 'Unknown'}\n`;
917
+ if (ctx.componentPath) text += `**Component:** ${ctx.componentPath}\n`;
918
+ if (ctx.repository) text += `**Repository:** ${ctx.repository.name} (${ctx.repository.repoType}) — ${ctx.repository.repoUrl}\n`;
919
+ text += `\n`;
920
+
921
+ text += `### Description\n\n${ctx.description}\n\n`;
922
+
923
+ if (ctx.acceptanceCriteria?.length > 0) {
924
+ text += `### Acceptance Criteria\n\n`;
925
+ ctx.acceptanceCriteria.forEach((ac, i) => { text += `${i + 1}. ${ac}\n`; });
926
+ text += `\n`;
927
+ }
928
+
929
+ if (ctx.architecturalNotes?.length > 0) {
930
+ text += `### Existing Notes\n\n`;
931
+ ctx.architecturalNotes.forEach(n => { text += `- ${n}\n`; });
932
+ text += `\n`;
933
+ }
934
+
935
+ return { content: [{ type: 'text', text }] };
936
+ } catch (err) {
937
+ const msg = err.message?.includes('BUG_NOT_FOUND') || err.message?.includes('404')
938
+ ? `Ticket ${ticketId} not found or is not a bug.`
939
+ : `Failed to load bug context: ${err.message}`;
940
+ return { content: [{ type: 'text', text: msg }], isError: true };
941
+ }
942
+ }
943
+ );
944
+
945
+ // Tool: Submit bug enrichment
946
+ server.tool(
947
+ 'submit_bug_enrichment',
948
+ 'Submit structured technical enrichment for a bug ticket. At least one field must be provided. The enrichment is append-only — the original description is never modified.',
949
+ {
950
+ ticketId: z.string().describe('The ticket ID or key (e.g. KON-42) of the bug to enrich'),
951
+ suspectedRootCause: z.string().optional().describe('Your assessment of why the bug occurs'),
952
+ affectedComponents: z.array(z.string()).optional().describe('File paths or module names involved'),
953
+ stackTraceHints: z.array(z.string()).optional().describe('Relevant error origins, log lines, or exception paths'),
954
+ investigationSteps: z.array(z.string()).optional().describe('What you checked and what you found'),
955
+ verifyFixCriteria: z.array(z.string()).optional().describe('Conditions that confirm the bug is fixed (appended to acceptance criteria)'),
956
+ },
957
+ async ({ ticketId, suspectedRootCause, affectedComponents, stackTraceHints, investigationSteps, verifyFixCriteria }) => {
958
+ if (!suspectedRootCause && !affectedComponents?.length && !stackTraceHints?.length && !investigationSteps?.length && !verifyFixCriteria?.length) {
959
+ return { content: [{ type: 'text', text: 'At least one enrichment field must be provided.' }], isError: true };
960
+ }
961
+
962
+ try {
963
+ const result = await konductroFetch(`/api/cli/bugs/${encodeURIComponent(ticketId)}/enrich`, {
964
+ method: 'POST',
965
+ body: JSON.stringify({ suspectedRootCause, affectedComponents, stackTraceHints, investigationSteps, verifyFixCriteria }),
966
+ });
967
+
968
+ const applied = result.fieldsApplied?.length > 0
969
+ ? `Enrichment applied: ${result.fieldsApplied.join(', ')}`
970
+ : 'No new enrichment applied (fields may already exist on the ticket).';
971
+ return { content: [{ type: 'text', text: applied }] };
972
+ } catch (err) {
973
+ const msg = err.message?.includes('BUG_NOT_FOUND') || err.message?.includes('404')
974
+ ? `Ticket ${ticketId} not found or is not a bug.`
975
+ : err.message?.includes('INVALID_ENRICHMENT')
976
+ ? 'At least one enrichment field must be provided.'
977
+ : `Failed to submit enrichment: ${err.message}`;
978
+ return { content: [{ type: 'text', text: msg }], isError: true };
979
+ }
980
+ }
981
+ );
982
+
902
983
  // Start the server
903
984
  async function main() {
904
985
  const transport = new StdioServerTransport();
@@ -0,0 +1,69 @@
1
+ ---
2
+ name: konductro-bug-enrich
3
+ description: Enrich an existing bug ticket with technical analysis. Use when assigned to triage a bug — fetches the ticket, explores the codebase locally, and submits structured technical context back to Konductro.
4
+ ---
5
+
6
+ # Konductro Bug Enrichment
7
+
8
+ You are enriching an existing bug ticket with technical context for the Konductro delivery platform. Your role is to add structured technical detail — never to rewrite or modify the user's original bug description.
9
+
10
+ ## Critical Constraint
11
+
12
+ **DO NOT modify the original `description` of the ticket.** The enrichment is append-only. Your job is to add technical context (root cause, affected components, investigation steps) — the user's original report is preserved byte-for-byte by the server.
13
+
14
+ ## Workflow
15
+
16
+ ### Step 1: Accept Ticket ID
17
+
18
+ The user provides a ticket ID (e.g. `KON-42` or a UUID) as a positional argument from `/bug-enrich <ticket-id>`.
19
+
20
+ ### Step 2: Load Bug Context
21
+
22
+ Call `get_bug_for_enrichment` with the ticket ID. This returns:
23
+ - The bug title, description, and existing acceptance criteria
24
+ - Project and phase context
25
+ - Any existing architectural notes or component path
26
+
27
+ Review the bug report and share a summary with the user. Confirm you understand the issue.
28
+
29
+ ### Step 3: Explore the Codebase
30
+
31
+ The user has the target repository cloned locally. Use Glob, Grep, and Read to investigate:
32
+
33
+ - **Affected code paths** — trace the flow described in the bug report
34
+ - **Potential root cause** — look for the code that could produce the described behaviour
35
+ - **Related components** — what files/modules are involved
36
+ - **Stack trace clues** — if error messages are mentioned, find where they originate
37
+ - **Fix verification** — what would need to be true for the bug to be resolved
38
+
39
+ Focus your exploration on what's relevant to the bug. Don't scan the entire codebase.
40
+
41
+ ### Step 4: Plan the Enrichment
42
+
43
+ Based on your investigation, prepare structured enrichment fields:
44
+
45
+ - **suspectedRootCause** — your best assessment of why the bug occurs (reference specific code)
46
+ - **affectedComponents** — file paths or module names involved
47
+ - **stackTraceHints** — relevant error origins, log lines, or exception paths
48
+ - **investigationSteps** — what you checked and what you found
49
+ - **verifyFixCriteria** — specific conditions that confirm the bug is fixed (these get appended to acceptance criteria)
50
+
51
+ Present your findings to the user before submitting.
52
+
53
+ ### Step 5: Submit Enrichment
54
+
55
+ After the user approves, call `submit_bug_enrichment` with the ticket ID and your structured findings. The server applies them using append-only rules:
56
+ - `architecturalNotes` receives prefixed entries
57
+ - `componentPath` is set only if currently empty
58
+ - `acceptanceCriteria` receives verify-fix criteria (de-duplicated)
59
+
60
+ Report success and summarise what was applied.
61
+
62
+ ## Important Rules
63
+
64
+ - Always load the bug context first — don't assume or hallucinate ticket contents
65
+ - Explore the ACTUAL local codebase — don't invent file paths or code snippets
66
+ - Reference specific files, line numbers, and function names in your findings
67
+ - Present findings for user review before submitting
68
+ - Never modify the original description — enrichment is additive only
69
+ - If you can't find relevant code, say so honestly rather than guessing
@@ -44,7 +44,7 @@ Based on the story requirements and your codebase understanding, plan the tasks.
44
44
  - **Execution order** — what needs to be built first (e.g., schema before API before UI)
45
45
  - **Task boundaries** — each task should be a single PR, touching one concern
46
46
  - **Repository assignment** — which repo does each task belong to
47
- - **Task type** — `api_node`, `api_java`, `ui_component`, `android`, `ios`, `infra`
47
+ - **Task type** — a short free-text tech tag derived from the target repo's stack (e.g. `C#`, `PHP`, `Node`, `Java`, `Angular`, `UI`, `Infra`). One canonical token, max 24 chars — there is no fixed list; match the repo's actual language/domain.
48
48
  - **Dependencies between tasks** — task 2 may depend on task 1's API
49
49
 
50
50
  Present your proposed decomposition to the user before submitting.
@@ -56,7 +56,7 @@ For each task, produce the full developer brief — this is the complete impleme
56
56
  1. **title** — short, action-oriented (e.g., "Add sprint.projectId column and migration")
57
57
  2. **description** — technical description of what to build and how, referencing specific files, patterns, and APIs
58
58
  3. **repositoryId** — from the context (the repo this task targets)
59
- 4. **type** — `api_node`, `api_java`, `ui_component`, `android`, `ios`, `infra`
59
+ 4. **type** — short free-text tech tag from the repo's stack (e.g. `C#`, `PHP`, `Node`, `Java`, `Angular`, `UI`, `Infra`); one canonical token, max 24 chars, no fixed list
60
60
  5. **acceptanceCriteria** — specific, testable criteria for this task
61
61
  6. **architecturalNotes** — implementation hints, patterns to follow, gotchas
62
62
  7. **componentPath** — primary file or directory being changed