Skip to content

Commit d11f994

Browse files
homeofeCopilot
andcommitted
chore: update handoff state (aahp-runner scan)
Auto-committed MANIFEST.json / NEXT_ACTIONS.md / .gitignore updates from aahp-runner GitHub issue sync and project scanning. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent e0c4f6e commit d11f994

3 files changed

Lines changed: 144 additions & 27 deletions

File tree

.ai/handoff/MANIFEST.json

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,54 @@
3838
"depends_on": [],
3939
"priority": "low",
4040
"completed": "2026-02-27T14:12:58.299Z"
41+
},
42+
"T-004": {
43+
"title": "Add --copy flag for clipboard output [medium]",
44+
"status": "ready",
45+
"priority": "medium",
46+
"depends_on": [],
47+
"created": "2026-03-02T03:48:11.827Z",
48+
"github_issue": 1,
49+
"github_repo": "elvatis/commitprompt"
50+
},
51+
"T-005": {
52+
"title": "Support reading diff from stdin [medium]",
53+
"status": "ready",
54+
"priority": "medium",
55+
"depends_on": [],
56+
"created": "2026-03-02T03:48:11.827Z",
57+
"github_issue": 2,
58+
"github_repo": "elvatis/commitprompt"
59+
},
60+
"T-006": {
61+
"title": "Add --branch flag for branch diff comparison [medium]",
62+
"status": "ready",
63+
"priority": "medium",
64+
"depends_on": [],
65+
"created": "2026-03-02T03:48:11.828Z",
66+
"github_issue": 3,
67+
"github_repo": "elvatis/commitprompt"
68+
},
69+
"T-007": {
70+
"title": "Add --type flag to override change type detection [low]",
71+
"status": "ready",
72+
"priority": "medium",
73+
"depends_on": [],
74+
"created": "2026-03-02T03:48:11.828Z",
75+
"github_issue": 4,
76+
"github_repo": "elvatis/commitprompt"
77+
},
78+
"T-008": {
79+
"title": "Shell autocomplete [low]",
80+
"status": "ready",
81+
"priority": "medium",
82+
"depends_on": [],
83+
"created": "2026-03-02T03:48:11.828Z",
84+
"github_issue": 5,
85+
"github_repo": "elvatis/commitprompt"
4186
}
4287
},
43-
"next_task_id": 4,
88+
"next_task_id": 9,
4489
"files": {
4590
"NEXT_ACTIONS.md": {
4691
"updated": "2026-02-28T00:00:00Z",

.ai/handoff/NEXT_ACTIONS.md

Lines changed: 97 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,105 @@
1-
# NEXT_ACTIONS.md - commitprompt
1+
# NEXT_ACTIONS - commitprompt
22

3-
## Priority Order
3+
## Current State
44

5-
### ~~1. npm publish~~ (DONE)
6-
- Published as `@elvatis_com/commitprompt@0.1.0`
7-
- Live at: https://www.npmjs.com/package/@elvatis_com/commitprompt
5+
v0.1.0 published on npm. 59/59 tests passing. All quality gates (lint, type check, tests) green.
6+
GitHub Actions and GitLab CI live. ESLint with typescript-eslint and custom no-em-dash rule configured.
87

9-
### 2. --context flag enhancement (LOW)
10-
- Currently reads package.json name
11-
- Extend to read first paragraph of README.md
12-
- Include in prompt header as context block
8+
## Ready - Work These Next
139

14-
### 3. ESLint setup (LOW)
15-
- Add eslint with typescript-eslint
16-
- Add `npm run lint` to CI
17-
- Enforce no-em-dash rule via custom lint rule
10+
### T-004: Add --copy flag for clipboard output [medium] (issue #1)
1811

19-
### 4. GitLab CI support (LOW)
20-
- Add `.gitlab-ci.yml` template
21-
- Mirror the GitHub Actions workflow
12+
- **Goal:** Copy the generated prompt directly to the system clipboard, eliminating the manual copy step
13+
- **Context:** The entire value proposition is "paste into an LLM". Right now users must manually select and copy terminal output. A `--copy` flag closes the last-mile UX gap. Use Node.js child_process to call the platform-native clipboard command (`clip` on Windows, `pbcopy` on macOS, `xclip`/`xsel` on Linux) - no new dependencies needed.
14+
- **What to do:**
15+
1. Add a `copyToClipboard(text: string): void` helper in a new `clipboard.ts` module
16+
2. Detect platform via `process.platform` and spawn the appropriate command (`clip`, `pbcopy`, `xclip -selection clipboard`)
17+
3. Pipe the prompt text to the spawned process via stdin
18+
4. Add `--copy` flag to CLI in `index.ts` - when set, copy output AND still print to stdout
19+
5. Print a confirmation line to stderr (e.g., "Copied to clipboard") so stdout stays clean for piping
20+
6. Add unit tests for the clipboard module (mock `child_process.execSync`)
21+
7. Update README.md with the new flag
22+
- **Files:** `src/clipboard.ts` (new), `src/index.ts`, `src/__tests__/clipboard.test.ts` (new), `README.md`
23+
- **Definition of Done:**
24+
- [ ] `commitprompt --copy` copies prompt to clipboard and prints confirmation to stderr
25+
- [ ] `commitprompt --copy --mode pr` works with all modes
26+
- [ ] Graceful error when clipboard command unavailable (warning, not crash)
27+
- [ ] Tests pass including new clipboard tests
28+
- [ ] README documents the flag
2229

23-
### 5. Shell autocomplete (OPTIONAL)
24-
- Add `commitprompt completion` command via commander
25-
- Support bash/zsh/fish
30+
### T-005: Support reading diff from stdin [medium] (issue #2)
2631

27-
## Completed
32+
- **Goal:** Enable piping diffs into commitprompt via stdin (e.g., `git diff HEAD~3 | commitprompt --mode pr`)
33+
- **Context:** Currently the tool only reads from `git diff --staged` or a file via `--diff`. Unix convention expects CLI tools to accept stdin when no file argument is given. This unlocks workflows like comparing arbitrary refs, using with other diff tools, or chaining in shell scripts. When neither `--diff` nor `--staged` is specified and stdin is not a TTY, read from stdin.
34+
- **What to do:**
35+
1. In `diff-reader.ts`, add `readStdin(): string` that reads from `process.stdin` synchronously (use `fs.readFileSync('/dev/stdin', 'utf-8')` or `fs.readFileSync(0, 'utf-8')`)
36+
2. In `index.ts`, detect piped input: if no `--diff` and no `--staged` flag, check `process.stdin.isTTY` - if falsy, read stdin instead of running `git diff --staged`
37+
3. Add integration test: write a diff to a temp file, then test the stdin reading path
38+
4. Update README.md with piping examples
39+
- **Files:** `src/diff-reader.ts`, `src/index.ts`, `src/__tests__/integration.test.ts`, `README.md`
40+
- **Definition of Done:**
41+
- [ ] `git diff HEAD~3 | commitprompt` works and produces correct prompt
42+
- [ ] `cat changes.diff | commitprompt --mode pr` works
43+
- [ ] When stdin is a TTY and no flags given, default behavior (staged diff) is preserved
44+
- [ ] Tests cover the stdin code path
45+
- [ ] README shows piping examples
2846

29-
- [x] Initial implementation: diff reader, parser, prompt builder, CLI
30-
- [x] 42/42 tests passing using real fixtures
31-
- [x] GitHub Actions CI live
32-
- [x] E2E test verified (output in src/fixtures/e2e-output.txt)
33-
- [x] AAHP handoff files created
34-
- [x] Published to npm as `@elvatis_com/commitprompt@0.1.0` (2026-02-21)
47+
### T-006: Add --branch flag for branch diff comparison [medium] (issue #3)
48+
49+
- **Goal:** Generate prompts from the full diff between current branch and a base branch, ideal for PR descriptions
50+
- **Context:** The `--mode pr` flag exists but reads only staged changes. For PR workflows, users need the complete branch diff. A `--branch <base>` flag that runs `git diff <base>...HEAD` provides the full picture. This makes `commitprompt --mode pr --branch main` the natural workflow before opening a PR.
51+
- **What to do:**
52+
1. In `diff-reader.ts`, add `readBranchDiff(base: string, cwd?: string): string` that runs `git diff <base>...HEAD`
53+
2. Add `--branch <base>` option to CLI in `index.ts`
54+
3. Make `--branch` mutually exclusive with `--diff` and `--staged` (error if combined)
55+
4. Add a fixture for a multi-commit branch diff and write tests
56+
5. Update README.md with branch comparison examples
57+
- **Files:** `src/diff-reader.ts`, `src/index.ts`, `src/__tests__/integration.test.ts`, `README.md`
58+
- **Definition of Done:**
59+
- [ ] `commitprompt --branch main --mode pr` outputs a prompt with the full branch diff
60+
- [ ] Error message when `--branch` combined with `--diff`
61+
- [ ] Error message when branch name is invalid or not found
62+
- [ ] Tests cover the branch diff code path
63+
- [ ] README documents the flag with examples
64+
65+
### T-007: Add --type flag to override change type detection [low] (issue #4)
66+
67+
- **Goal:** Let users override the auto-detected change type when heuristics get it wrong
68+
- **Context:** The TRUST.md notes that `changeType` heuristics are path-based and can misclassify mixed-purpose changes. A `--type fix` flag gives users control. This is a small addition with clear value for edge cases.
69+
- **What to do:**
70+
1. Add `--type <type>` option to CLI in `index.ts` with choices matching the `ChangeType` union
71+
2. When provided, override `parsedDiff.changeType` before passing to `buildPrompt`
72+
3. Validate the value against known types; show clear error for invalid types
73+
4. Add tests for the override behavior
74+
5. Update README.md
75+
- **Files:** `src/index.ts`, `src/__tests__/integration.test.ts`, `README.md`
76+
- **Definition of Done:**
77+
- [ ] `commitprompt --type fix` forces changeType to 'fix' regardless of heuristics
78+
- [ ] Invalid type values produce a clear error message
79+
- [ ] Tests verify override behavior
80+
- [ ] README documents the flag
81+
82+
### T-008: Shell autocomplete [low] (issue #5)
83+
84+
- **Goal:** Add tab completion for commitprompt flags in bash, zsh, and fish shells
85+
- **Context:** Commander v12 has built-in support for generating shell completion scripts. This is polish that improves discoverability of flags for regular users.
86+
- **What to do:**
87+
1. Research Commander's `program.completions()` API or use a helper like `tabtab`
88+
2. Add a `commitprompt completion` subcommand that outputs the completion script
89+
3. Document installation instructions for bash, zsh, and fish in README.md
90+
4. Test that the completion script is valid shell syntax
91+
- **Files:** `src/index.ts`, `README.md`
92+
- **Definition of Done:**
93+
- [ ] `commitprompt completion` outputs a working completion script
94+
- [ ] At least bash and zsh are supported
95+
- [ ] README includes installation instructions for completions
96+
97+
## Blocked
98+
99+
(none)
100+
101+
## Recently Completed
102+
103+
T-003: Add GitLab CI support (.gitlab-ci.yml template)
104+
T-001: Add --context flag (reads first paragraph of README.md into prompt)
105+
T-002: ESLint setup with typescript-eslint and no-em-dash rule

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ node_modules/
22
dist/
33
*.log
44
.env
5+
.ai/logs/

0 commit comments

Comments
 (0)