@greeana/jira-dev-workflow 0.1.0 → 0.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
@@ -64,6 +64,7 @@ JIRA_API_TOKEN=your_jira_api_token
64
64
  ```bash
65
65
  npm install
66
66
  npm test
67
+ npm run test-install
67
68
  node ./bin/jira-dev-workflow.mjs help
68
69
  ```
69
70
 
@@ -88,7 +89,27 @@ npx -y @greeana/jira-dev-workflow@preview install --preview
88
89
  Generate a repo-local skill pinned to an exact published version:
89
90
 
90
91
  ```bash
91
- npx -y @greeana/jira-dev-workflow@0.1.0-preview.0 install --version 0.1.0-preview.0
92
+ npx -y @greeana/jira-dev-workflow@0.1.1-preview.0 install --version 0.1.1-preview.0
93
+ ```
94
+
95
+ Smoke-test the current checkout as if it were published by packing it locally and
96
+ running the packaged `install` command against the current repo:
97
+
98
+ ```bash
99
+ npm run test-install
100
+ ```
101
+
102
+ Pass extra `install` flags through the smoke test:
103
+
104
+ ```bash
105
+ npm run test-install -- --force --project-key JDW
106
+ ```
107
+
108
+ To run the same dev-only smoke test against a different repo, change into that repo and
109
+ invoke this checkout's script directly:
110
+
111
+ ```bash
112
+ node --import tsx /absolute/path/to/jira-dev-workflow/scripts/test-install.ts
92
113
  ```
93
114
 
94
115
  This creates:
@@ -102,6 +123,8 @@ This creates:
102
123
  It also ensures `.gitignore` contains:
103
124
 
104
125
  ```text
126
+ .codex/skills/jira-dev-workflow/
127
+ .jira-dev-workflow/config.json
105
128
  .jira-dev-workflow/.env.local
106
129
  .jira-dev-workflow/state/
107
130
  ```
@@ -135,7 +158,7 @@ npx -y @greeana/jira-dev-workflow@preview install --preview
135
158
  Install into the current repo and pin the generated skill to an exact published version:
136
159
 
137
160
  ```bash
138
- npx -y @greeana/jira-dev-workflow@0.1.0-preview.0 install --version 0.1.0-preview.0
161
+ npx -y @greeana/jira-dev-workflow@0.1.1-preview.0 install --version 0.1.1-preview.0
139
162
  ```
140
163
 
141
164
  Install into the current repo and make the generated skill call a local checkout directly:
@@ -282,10 +305,11 @@ The skill assumes the published package name is `@greeana/jira-dev-workflow`. If
282
305
 
283
306
  1. Update `version` in `package.json`.
284
307
  2. Run `npm test`.
285
- 3. Run `npm pack --dry-run` and confirm only the intended files are included.
286
- 4. Confirm `skill/jira-dev-workflow/SKILL.md` still points to `npx -y @greeana/jira-dev-workflow`.
287
- 5. Publish with `npm publish --access public`.
288
- 6. Smoke-test the published package:
308
+ 3. Run `npm run test-install` from this repo, or invoke `scripts/test-install.ts` from a scratch repo.
309
+ 4. Run `npm pack --dry-run` and confirm only the intended files are included.
310
+ 5. Confirm `skill/jira-dev-workflow/SKILL.md` still points to `npx -y @greeana/jira-dev-workflow`.
311
+ 6. Publish with `npm publish --access public`.
312
+ 7. Smoke-test the published package:
289
313
 
290
314
  ```bash
291
315
  npx -y @greeana/jira-dev-workflow help
@@ -1,10 +1,14 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  import { spawnSync } from "node:child_process";
4
+ import { createRequire } from "node:module";
4
5
  import path from "node:path";
5
- import { fileURLToPath } from "node:url";
6
+ import { fileURLToPath, pathToFileURL } from "node:url";
6
7
 
7
8
  const packageDir = path.dirname(path.dirname(fileURLToPath(import.meta.url)));
9
+ const invocationCwd = process.env.INIT_CWD ? path.resolve(process.env.INIT_CWD) : process.cwd();
10
+ const require = createRequire(import.meta.url);
11
+ const tsxLoader = pathToFileURL(require.resolve("tsx")).href;
8
12
  const commandMap = new Map([
9
13
  ["unit", "tests"],
10
14
  ["install", "src/install.ts"],
@@ -58,7 +62,7 @@ function main() {
58
62
 
59
63
  function runCommand(commandName, commandArgs) {
60
64
  if (commandName === "unit") {
61
- const result = spawnSync(process.execPath, ["--import", "tsx", "--test", "tests/**/*.test.ts", ...commandArgs], {
65
+ const result = spawnSync(process.execPath, ["--import", tsxLoader, "--test", "tests/**/*.test.ts", ...commandArgs], {
62
66
  cwd: packageDir,
63
67
  stdio: "inherit",
64
68
  });
@@ -73,8 +77,8 @@ function runCommand(commandName, commandArgs) {
73
77
  return;
74
78
  }
75
79
 
76
- const result = spawnSync(process.execPath, ["--import", "tsx", entry, ...commandArgs], {
77
- cwd: packageDir,
80
+ const result = spawnSync(process.execPath, ["--import", tsxLoader, path.join(packageDir, entry), ...commandArgs], {
81
+ cwd: invocationCwd,
78
82
  stdio: "inherit",
79
83
  });
80
84
 
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@greeana/jira-dev-workflow",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "CLI for Jira-backed development workflows: issue search/create, commit preparation, implementation comments, and imports.",
5
5
  "type": "module",
6
6
  "bin": {
7
- "jira-dev-workflow": "./bin/jira-dev-workflow.mjs"
7
+ "jira-dev-workflow": "bin/jira-dev-workflow.mjs"
8
8
  },
9
9
  "files": [
10
10
  "bin",
@@ -16,6 +16,7 @@
16
16
  ],
17
17
  "scripts": {
18
18
  "test": "node --import tsx --test tests/**/*.test.ts",
19
+ "test-install": "node --import tsx ./scripts/test-install.ts",
19
20
  "install-workflow": "node --import tsx src/install.ts",
20
21
  "test-connection": "node --import tsx src/test-connection.ts",
21
22
  "find": "node --import tsx src/find-issue.ts",
@@ -58,13 +58,14 @@ npx -y @greeana/jira-dev-workflow use --issue JDW-123
58
58
 
59
59
  5. If there are no open matches and only closed matches exist, create a new issue and pass the best closed match as `--related-issue`.
60
60
  6. If UI or preview evidence is useful, attach screenshots or add an implementation report comment.
61
- 7. Preview the commit message with:
61
+ 7. Before previewing the commit message, inspect the actual staged diff and derive a concise human message that matches the implementation, not just the Jira issue summary or the draft returned by `prepare-commit`.
62
+ 8. Preview the commit message with:
62
63
 
63
64
  ```bash
64
65
  npx -y @greeana/jira-dev-workflow commit --issue JDW-123 -m "Short commit message" --dry-run
65
66
  ```
66
67
 
67
- 8. After the user confirms, commit with:
68
+ 9. After the user confirms, commit with:
68
69
 
69
70
  ```bash
70
71
  npx -y @greeana/jira-dev-workflow commit -m "Short commit message"
@@ -79,15 +80,17 @@ When the user asks to prepare a Jira commit, the agent must treat `prepare-commi
79
80
  3. If `openMatches` contains candidates, present them and ask the user which issue to use, or whether to create a new one instead.
80
81
  4. If there are no reusable open matches, present the drafted new-issue summary and description and ask the user whether to create that issue.
81
82
  5. Do not create a Jira issue, do not save a current issue, do not commit, and do not post comments while still in the `prepare commit` step.
82
- 6. After the user selects an issue or approves creating a new one, preview the final commit message with `commit --dry-run` and ask for confirmation.
83
- 7. Only create the git commit after explicit user confirmation.
84
- 8. Only post an implementation comment or attach files after the user explicitly asks for that, or clearly confirms a workflow that includes posting after commit.
83
+ 6. After the user selects an issue or approves creating a new one, inspect `git diff --cached --stat` and, if needed, `git diff --cached` to understand the actual change set before proposing a commit title.
84
+ 7. Treat `commitMessageDrafts` as hints only. Do not blindly reuse the Jira issue summary or the draft from `prepare-commit` when the staged diff is narrower or more specific.
85
+ 8. Preview the final commit message with `commit --dry-run` and ask for confirmation.
86
+ 9. Only create the git commit after explicit user confirmation.
87
+ 10. Only post an implementation comment or attach files after the user explicitly asks for that, or clearly confirms a workflow that includes posting after commit.
85
88
 
86
89
  The intended conversation shape is:
87
90
  - User stages changes and asks to prepare a Jira commit.
88
91
  - Agent runs `prepare-commit`, shows candidate issues or a new-issue draft, and asks the user to choose.
89
92
  - User selects an existing issue or approves creating a new one.
90
- - Agent shows the final commit message preview and asks for confirmation.
93
+ - Agent inspects the staged diff, proposes a commit message that matches the actual implementation, then shows the final commit message preview and asks for confirmation.
91
94
  - User confirms.
92
95
  - Agent commits, and only then posts back to Jira if the user asked for posting.
93
96
 
@@ -97,6 +100,8 @@ The intended conversation shape is:
97
100
  - If only closed issues match, create a new issue and relate it to the best closed match.
98
101
  - Prefer `npx -y @greeana/jira-dev-workflow prepare-commit --json` for commit workflows because it includes both Jira matches and draft commit text.
99
102
  - Use `npx -y @greeana/jira-dev-workflow current` if you need to confirm the selected issue before commit.
103
+ - Read the staged diff before proposing the final commit title.
104
+ - Treat `commitMessageDrafts` as a starting point, not the final message.
100
105
  - For commit messages, keep the human part short because the Jira key is prefixed automatically by the workflow.
101
106
  - For implementation reports with screenshots, prefer `comment --text-file ... --inline-file ...` and place screenshot markers as standalone paragraphs inside the text:
102
107
  - `[[inline-file]]` inserts the next screenshot in order
package/src/install.ts CHANGED
@@ -11,7 +11,12 @@ const localWorkflowDir = ".jira-dev-workflow";
11
11
  const localConfigFile = path.join(localWorkflowDir, "config.json");
12
12
  const localEnvFile = path.join(localWorkflowDir, ".env.local");
13
13
  const localStateDir = path.join(localWorkflowDir, "state");
14
- const gitignoreEntries = [".jira-dev-workflow/.env.local", ".jira-dev-workflow/state/"];
14
+ const gitignoreEntries = [
15
+ ".codex/skills/jira-dev-workflow/",
16
+ ".jira-dev-workflow/config.json",
17
+ ".jira-dev-workflow/.env.local",
18
+ ".jira-dev-workflow/state/",
19
+ ];
15
20
 
16
21
  export type InstallOptions = {
17
22
  force: boolean;