codiedev 0.8.0 → 0.8.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/dist/cli.js +0 -3
- package/dist/commands/createTicket.js +1 -7
- package/dist/hook.js +0 -0
- package/package.json +1 -1
- package/dist/createTicketSkill.d.ts +0 -12
- package/dist/createTicketSkill.js +0 -146
package/dist/cli.js
CHANGED
|
@@ -69,7 +69,6 @@ Artifacts:
|
|
|
69
69
|
"single repo or multiple? where?", then
|
|
70
70
|
emits a plan with N+1 split. Lands in
|
|
71
71
|
/portal/research/<id>; push to Jira from there.
|
|
72
|
-
Beta — opt-in via betaCreateTicket.
|
|
73
72
|
codiedev create-ticket --submit <path|->
|
|
74
73
|
Internal: Claude calls this itself with
|
|
75
74
|
a plan JSON to submit. Use - for stdin.
|
|
@@ -266,8 +265,6 @@ codiedev create-ticket — forward-write a scoped ticket plan
|
|
|
266
265
|
Single ticket renders as one ticket; multi-ticket renders as a folder/group.
|
|
267
266
|
Push to Jira from the portal.
|
|
268
267
|
|
|
269
|
-
Beta. Opt-in by setting userProfiles.betaCreateTicket = true on your row.
|
|
270
|
-
|
|
271
268
|
Examples:
|
|
272
269
|
codiedev create-ticket
|
|
273
270
|
codiedev create-ticket "I want to add Google SSO"
|
|
@@ -155,13 +155,7 @@ async function runBare(config, prompt) {
|
|
|
155
155
|
res = await (0, shared_1.apiRequest)("GET", "/api/cli/createTicketProtocol", { config });
|
|
156
156
|
}
|
|
157
157
|
catch (err) {
|
|
158
|
-
|
|
159
|
-
if (status === 403) {
|
|
160
|
-
console.error("create-ticket is in beta and not enabled for your account. Ask your CodieDev admin to flip betaCreateTicket on your profile.");
|
|
161
|
-
}
|
|
162
|
-
else {
|
|
163
|
-
console.error(`Failed to fetch create-ticket protocol: ${err.message}. Check your network connection and re-run.`);
|
|
164
|
-
}
|
|
158
|
+
console.error(`Failed to fetch create-ticket protocol: ${err.message}. Check your network connection and re-run.`);
|
|
165
159
|
process.exit(1);
|
|
166
160
|
}
|
|
167
161
|
process.stdout.write(substitutePrompt(res.protocol, prompt));
|
package/dist/hook.js
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Skill instructions printed to stdout when `codiedev create-ticket` is
|
|
3
|
-
* invoked without `--submit`. Claude (running the CLI via Bash) reads
|
|
4
|
-
* this content and follows the protocol: ask the dev about repos,
|
|
5
|
-
* investigate locally, emit a plan, call back into the CLI to submit.
|
|
6
|
-
*
|
|
7
|
-
* The scoping rules (#### TICKET QUALITY BAR onwards) are lifted verbatim
|
|
8
|
-
* from `modal/runner.py:_format_ticket_from_analysis` so the CLI path
|
|
9
|
-
* produces structurally-identical plans to the Modal path.
|
|
10
|
-
*/
|
|
11
|
-
export declare const CREATE_TICKET_SKILL_INSTRUCTIONS = "\nYou are conducting a forward ticket-writing session for the user via codiedev.\nFollow this protocol exactly. Do not improvise the ticket structure.\n\n## Step 1 \u2014 Ask about repos\nAsk the user once:\n \"Is this work in a single repo or across multiple? If multiple, please tell me where each one is located on disk.\"\nWait for their reply. They will give you absolute paths like /Users/x/code/foo.\n\n## Step 2 \u2014 Investigate (read-only)\nFor each repo path the user gave you:\n - cd into the repo\n - Read the user's intent (their prompt, given below)\n - Find the primary files related to that intent. Use grep for class names,\n function names, enum values, constants, file names extracted from the prompt.\n - For each file found, report what it contains: function signatures, enum\n values, switch/case statements, existing patterns.\n - Grep for who imports each file (consumers, dependencies).\n - Check for existing tests related to those files.\n - Note migration patterns, naming conventions, barrel exports.\nDO NOT modify any files. This is read-only.\n\n## Step 2.5 \u2014 Ask if the prompt doesn't match the codebase\n\nBefore writing the plan, check: do the user's literal words appear in the codebase as named?\n\n- If they said \"delete X\" but only \"archive X\" / \"setArchived\" exists, ask one question quoting\n both sides: \"You said `delete`, but I see only `setArchived` \u2014 confirm the modal is for the\n archive button?\"\n- If they said \"the analytics dashboard\" but the named component (e.g. AnalyticsTab) is already\n reactive and the only useEffect-fetch lives elsewhere, ask: \"AnalyticsTab is already on\n useQuery; the only useEffect-fetch I found is in admin/page.tsx LangfuseCostsSection \u2014 is\n that the target?\"\n- If they named a feature/flag/component that doesn't exist at all, ask which of the closest\n matches they meant, listing each with a one-line reason it's plausible.\n\nDo NOT silently route to the closest match in these cases. Silently routing buries the mismatch\nin scope OUT and produces a ticket the user didn't ask for. One targeted question that quotes\nthe user's word AND the codebase's actual word is the right move.\n\nIf you also have a separate genuine ambiguity (two plausible places the change could go that\nboth match the user's words), bundle it into the same question \u2014 but don't fabricate ambiguity\nto hit a quota. If the words map to the codebase clearly, do not ask further questions \u2014\nproceed to Step 3.\n\n## Step 3 \u2014 Format the plan\n\nThe user's request defines WHAT to build. The investigation defines HOW to build it.\nYour job is to translate the user's exact request into actionable tickets using\nthe investigation as supporting evidence. The user chose their words carefully \u2014\nuse them.\n\nOutput a plan as one or more tickets. Each ticket becomes a single PR handled\nby a coding agent. The agent works alone and makes one PR per ticket.\n\nEACH TICKET = ONE MERGEABLE PR\nA ticket is ready when its PR can merge to main and the app compiles, renders,\nand passes tests with zero other tickets merged. This is the only rule that matters.\n\nHow to group work:\n- The investigation identified every file that needs to change. Your job is to\n package that into tickets, not to re-scope. Every file from the investigation\n appears in at least one ticket.\n- Each ticket becomes one PR. A PR should be focused enough that a reviewer\n understands it in one sitting and CI validates it fully.\n- Include every file needed for the change to be complete \u2014 don't leave wiring,\n migrations, or consumer updates for a follow-up.\n- If the work naturally spans independent modules, output multiple tickets ordered\n by dependency. Use the `dependsOn` field (array of zero-indexed ticket numbers\n this ticket depends on).\n- \"After this PR merges, the app:\" must describe a working state. If you can't,\n the ticket is incomplete \u2014 add what's missing.\n- Default to ONE ticket. Only split when ticket 2 could merge to main without\n ticket 1 and the app still compiles.\n\nQUALITY BAR \u2014 every ticket must:\n- Quantify the problem: count the calls, files, violations. \"6 manager.getRepository()\n calls\", not \"several calls\".\n- Name the codebase's own patterns: use the exact class names, method names, and\n conventions found in the investigation. \"injectable wrapper pattern with\n @InjectRepository\", not \"create a new class\".\n- Include specific file paths with line numbers from the investigation findings.\n- Say what stays the same: \"Keep standard CRUD in AceService\", \"do not export it\",\n \"no logic changes\".\n- Scope IN/OUT must reference concrete things in the codebase, not abstract categories.\n\nFor each ticket, fill these fields:\n - title: <80 chars, imperative mood\n - description: GIVEN/WHEN/THEN format, quantify the problem\n - technicalDetails: specific files with line numbers, the approach,\n patterns from the codebase to follow, what to keep unchanged\n - scope: IN: ... / OUT: ...\n - targetRepoId: leave empty for now \u2014 the CLI will fill this from the repo paths\n - targetRepoFullName: \"owner/name\" matching the git remote of the repo this\n ticket touches (e.g. \"ericlam1114/vm-demo\")\n - dependsOn: [zero-indexed ticket numbers] or [] if independent\n\n## Step 4 \u2014 Submit\nWhen the plan is ready, write it to a temp file as JSON matching this schema:\n\n{\n \"plan\": {\n \"summary\": \"<one sentence: what this plan delivers and how many tickets>\",\n \"tickets\": [\n {\n \"title\": \"...\",\n \"description\": \"...\",\n \"technicalDetails\": \"...\",\n \"scope\": \"...\",\n \"targetRepoFullName\": \"owner/name\",\n \"dependsOn\": []\n }\n ]\n },\n \"prompt\": \"<the user's original intent verbatim>\",\n \"repoFullNames\": [\"owner/name\", ...]\n}\n\nThen run:\n codiedev create-ticket --submit <path-to-temp-file.json>\n\nThe CLI will translate `targetRepoFullName` and `repoFullNames` into repo IDs,\nPOST the plan, and print the portal URL. Tell the user the URL when it returns.\n\n## The user's intent\n{{USER_PROMPT}}\n";
|
|
12
|
-
export declare function renderSkillInstructions(prompt: string | undefined): string;
|
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CREATE_TICKET_SKILL_INSTRUCTIONS = void 0;
|
|
4
|
-
exports.renderSkillInstructions = renderSkillInstructions;
|
|
5
|
-
/**
|
|
6
|
-
* Skill instructions printed to stdout when `codiedev create-ticket` is
|
|
7
|
-
* invoked without `--submit`. Claude (running the CLI via Bash) reads
|
|
8
|
-
* this content and follows the protocol: ask the dev about repos,
|
|
9
|
-
* investigate locally, emit a plan, call back into the CLI to submit.
|
|
10
|
-
*
|
|
11
|
-
* The scoping rules (#### TICKET QUALITY BAR onwards) are lifted verbatim
|
|
12
|
-
* from `modal/runner.py:_format_ticket_from_analysis` so the CLI path
|
|
13
|
-
* produces structurally-identical plans to the Modal path.
|
|
14
|
-
*/
|
|
15
|
-
exports.CREATE_TICKET_SKILL_INSTRUCTIONS = `
|
|
16
|
-
You are conducting a forward ticket-writing session for the user via codiedev.
|
|
17
|
-
Follow this protocol exactly. Do not improvise the ticket structure.
|
|
18
|
-
|
|
19
|
-
## Step 1 — Ask about repos
|
|
20
|
-
Ask the user once:
|
|
21
|
-
"Is this work in a single repo or across multiple? If multiple, please tell me where each one is located on disk."
|
|
22
|
-
Wait for their reply. They will give you absolute paths like /Users/x/code/foo.
|
|
23
|
-
|
|
24
|
-
## Step 2 — Investigate (read-only)
|
|
25
|
-
For each repo path the user gave you:
|
|
26
|
-
- cd into the repo
|
|
27
|
-
- Read the user's intent (their prompt, given below)
|
|
28
|
-
- Find the primary files related to that intent. Use grep for class names,
|
|
29
|
-
function names, enum values, constants, file names extracted from the prompt.
|
|
30
|
-
- For each file found, report what it contains: function signatures, enum
|
|
31
|
-
values, switch/case statements, existing patterns.
|
|
32
|
-
- Grep for who imports each file (consumers, dependencies).
|
|
33
|
-
- Check for existing tests related to those files.
|
|
34
|
-
- Note migration patterns, naming conventions, barrel exports.
|
|
35
|
-
DO NOT modify any files. This is read-only.
|
|
36
|
-
|
|
37
|
-
## Step 2.5 — Ask if the prompt doesn't match the codebase
|
|
38
|
-
|
|
39
|
-
Before writing the plan, check: do the user's literal words appear in the codebase as named?
|
|
40
|
-
|
|
41
|
-
- If they said "delete X" but only "archive X" / "setArchived" exists, ask one question quoting
|
|
42
|
-
both sides: "You said \`delete\`, but I see only \`setArchived\` — confirm the modal is for the
|
|
43
|
-
archive button?"
|
|
44
|
-
- If they said "the analytics dashboard" but the named component (e.g. AnalyticsTab) is already
|
|
45
|
-
reactive and the only useEffect-fetch lives elsewhere, ask: "AnalyticsTab is already on
|
|
46
|
-
useQuery; the only useEffect-fetch I found is in admin/page.tsx LangfuseCostsSection — is
|
|
47
|
-
that the target?"
|
|
48
|
-
- If they named a feature/flag/component that doesn't exist at all, ask which of the closest
|
|
49
|
-
matches they meant, listing each with a one-line reason it's plausible.
|
|
50
|
-
|
|
51
|
-
Do NOT silently route to the closest match in these cases. Silently routing buries the mismatch
|
|
52
|
-
in scope OUT and produces a ticket the user didn't ask for. One targeted question that quotes
|
|
53
|
-
the user's word AND the codebase's actual word is the right move.
|
|
54
|
-
|
|
55
|
-
If you also have a separate genuine ambiguity (two plausible places the change could go that
|
|
56
|
-
both match the user's words), bundle it into the same question — but don't fabricate ambiguity
|
|
57
|
-
to hit a quota. If the words map to the codebase clearly, do not ask further questions —
|
|
58
|
-
proceed to Step 3.
|
|
59
|
-
|
|
60
|
-
## Step 3 — Format the plan
|
|
61
|
-
|
|
62
|
-
The user's request defines WHAT to build. The investigation defines HOW to build it.
|
|
63
|
-
Your job is to translate the user's exact request into actionable tickets using
|
|
64
|
-
the investigation as supporting evidence. The user chose their words carefully —
|
|
65
|
-
use them.
|
|
66
|
-
|
|
67
|
-
Output a plan as one or more tickets. Each ticket becomes a single PR handled
|
|
68
|
-
by a coding agent. The agent works alone and makes one PR per ticket.
|
|
69
|
-
|
|
70
|
-
EACH TICKET = ONE MERGEABLE PR
|
|
71
|
-
A ticket is ready when its PR can merge to main and the app compiles, renders,
|
|
72
|
-
and passes tests with zero other tickets merged. This is the only rule that matters.
|
|
73
|
-
|
|
74
|
-
How to group work:
|
|
75
|
-
- The investigation identified every file that needs to change. Your job is to
|
|
76
|
-
package that into tickets, not to re-scope. Every file from the investigation
|
|
77
|
-
appears in at least one ticket.
|
|
78
|
-
- Each ticket becomes one PR. A PR should be focused enough that a reviewer
|
|
79
|
-
understands it in one sitting and CI validates it fully.
|
|
80
|
-
- Include every file needed for the change to be complete — don't leave wiring,
|
|
81
|
-
migrations, or consumer updates for a follow-up.
|
|
82
|
-
- If the work naturally spans independent modules, output multiple tickets ordered
|
|
83
|
-
by dependency. Use the \`dependsOn\` field (array of zero-indexed ticket numbers
|
|
84
|
-
this ticket depends on).
|
|
85
|
-
- "After this PR merges, the app:" must describe a working state. If you can't,
|
|
86
|
-
the ticket is incomplete — add what's missing.
|
|
87
|
-
- Default to ONE ticket. Only split when ticket 2 could merge to main without
|
|
88
|
-
ticket 1 and the app still compiles.
|
|
89
|
-
|
|
90
|
-
QUALITY BAR — every ticket must:
|
|
91
|
-
- Quantify the problem: count the calls, files, violations. "6 manager.getRepository()
|
|
92
|
-
calls", not "several calls".
|
|
93
|
-
- Name the codebase's own patterns: use the exact class names, method names, and
|
|
94
|
-
conventions found in the investigation. "injectable wrapper pattern with
|
|
95
|
-
@InjectRepository", not "create a new class".
|
|
96
|
-
- Include specific file paths with line numbers from the investigation findings.
|
|
97
|
-
- Say what stays the same: "Keep standard CRUD in AceService", "do not export it",
|
|
98
|
-
"no logic changes".
|
|
99
|
-
- Scope IN/OUT must reference concrete things in the codebase, not abstract categories.
|
|
100
|
-
|
|
101
|
-
For each ticket, fill these fields:
|
|
102
|
-
- title: <80 chars, imperative mood
|
|
103
|
-
- description: GIVEN/WHEN/THEN format, quantify the problem
|
|
104
|
-
- technicalDetails: specific files with line numbers, the approach,
|
|
105
|
-
patterns from the codebase to follow, what to keep unchanged
|
|
106
|
-
- scope: IN: ... / OUT: ...
|
|
107
|
-
- targetRepoId: leave empty for now — the CLI will fill this from the repo paths
|
|
108
|
-
- targetRepoFullName: "owner/name" matching the git remote of the repo this
|
|
109
|
-
ticket touches (e.g. "ericlam1114/vm-demo")
|
|
110
|
-
- dependsOn: [zero-indexed ticket numbers] or [] if independent
|
|
111
|
-
|
|
112
|
-
## Step 4 — Submit
|
|
113
|
-
When the plan is ready, write it to a temp file as JSON matching this schema:
|
|
114
|
-
|
|
115
|
-
{
|
|
116
|
-
"plan": {
|
|
117
|
-
"summary": "<one sentence: what this plan delivers and how many tickets>",
|
|
118
|
-
"tickets": [
|
|
119
|
-
{
|
|
120
|
-
"title": "...",
|
|
121
|
-
"description": "...",
|
|
122
|
-
"technicalDetails": "...",
|
|
123
|
-
"scope": "...",
|
|
124
|
-
"targetRepoFullName": "owner/name",
|
|
125
|
-
"dependsOn": []
|
|
126
|
-
}
|
|
127
|
-
]
|
|
128
|
-
},
|
|
129
|
-
"prompt": "<the user's original intent verbatim>",
|
|
130
|
-
"repoFullNames": ["owner/name", ...]
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
Then run:
|
|
134
|
-
codiedev create-ticket --submit <path-to-temp-file.json>
|
|
135
|
-
|
|
136
|
-
The CLI will translate \`targetRepoFullName\` and \`repoFullNames\` into repo IDs,
|
|
137
|
-
POST the plan, and print the portal URL. Tell the user the URL when it returns.
|
|
138
|
-
|
|
139
|
-
## The user's intent
|
|
140
|
-
{{USER_PROMPT}}
|
|
141
|
-
`;
|
|
142
|
-
function renderSkillInstructions(prompt) {
|
|
143
|
-
return exports.CREATE_TICKET_SKILL_INSTRUCTIONS.replace("{{USER_PROMPT}}", prompt && prompt.length > 0
|
|
144
|
-
? prompt
|
|
145
|
-
: "(not yet provided — ask the user a single combined question that covers both the intent AND repo locations: \"What are you working on, and is this in a single repo or multiple? If multiple, give me the paths.\" Skip Step 1 since you've folded it into this question. Then proceed to Step 2.)");
|
|
146
|
-
}
|