Skip to content

Fix no git#11

Merged
mrsimpson merged 5 commits into
mainfrom
fix-no-git
Mar 19, 2026
Merged

Fix no git#11
mrsimpson merged 5 commits into
mainfrom
fix-no-git

Conversation

@mrsimpson
Copy link
Copy Markdown
Contributor

No description provided.

## 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
@mrsimpson mrsimpson merged commit e9e3617 into main Mar 19, 2026
1 check passed
@mrsimpson mrsimpson deleted the fix-no-git branch March 19, 2026 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant