Fix no git#11
Merged
Merged
Conversation
## Intent
When `ade setup` is run in a directory that is not a git repository,
`writeGitHooks` crashed with ENOENT because it tried to write directly
to `.git/hooks/<phase>` without checking whether `.git` exists.
The fix preserves user awareness (backpressure) by warning instead of
crashing silently.
## Key changes
- `writeGitHooks` now checks for `.git` directory existence via
`fs/promises.access` before attempting to write hook files
- If `.git` is absent, a `clack.log.warn` message is emitted telling
the user the project is not a git repository and hooks were skipped
- `.git/hooks/` directory is created with `mkdir({ recursive: true })`
when `.git` exists but the `hooks` subdir is missing
- Added `@clack/prompts` as a runtime dependency to `ade-harnesses`
- Added `util.spec.ts` with 6 tests covering: undefined/empty hooks
(no-op), non-git-repo warn+skip, happy path write, missing hooks dir
creation, and multiple hooks
## Dependencies and side effects
- `@clack/prompts` is now a direct dependency of `@codemcp/ade-harnesses`
(same version already used by `@codemcp/cli`)
## Intent The skills installation process is noisy and can obscure important messages (e.g. the git hook warning). Giving users explicit control over when skills are installed improves the UX and ensures earlier messages are seen. ## Key changes - Both `ade setup` and `ade install` now prompt the user for confirmation before running `installSkills` - If the user declines, a `clack.log.info` message is shown with the manual fallback command: `npx @codemcp/skills experimental_install` - If there are no skills, the prompt is skipped entirely (no-op) - Updated `conventions.integration.spec.ts` mock to include `log` and default `confirm` to `true` so existing tests continue to install skills
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.