chore(dx): add AI workflow agents, prompts, and lefthook pre-commit#125
chore(dx): add AI workflow agents, prompts, and lefthook pre-commit#125
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the development workflow by integrating AI-driven tools and establishing clear guidelines. It introduces specialized AI agents for code review and documentation, alongside new prompts and skills to standardize practices like semantic versioning and testing. Furthermore, it enforces code quality through automated pre-push and session stop hooks, ensuring consistency and maintainability across the project. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (1)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
WalkthroughTests for AwsSsmSecretProvider were restructured to run conditionally (CI/INTEGRATION), initialize a LocalStack container in beforeAll and stop it in afterAll, increase the integration timeout to 60000ms, and inline AWS SSM command usage in test scopes. A new docs file describing AI workflows was added. Changes
Sequence Diagram(s)sequenceDiagram
participant Runner as Test Runner
participant Env as Environment Check
participant Container as LocalStack Container
participant Client as SSM Client
participant SSM as AWS SSM (LocalStack)
Runner->>Env: Check CI || INTEGRATION
alt enabled
Runner->>Container: Start LocalStack (beforeAll)
Container-->>Runner: Endpoint returned
Runner->>Client: Create SSM client with endpoint
Client-->>Runner: Client ready
rect rgba(100,150,200,0.5)
Note over Runner,SSM: Integration tests execute (timeout 60000ms)
Runner->>Client: PutParameterCommand (initial value)
Client->>SSM: Store parameter
SSM-->>Client: Success
Client-->>Runner: Response
Runner->>Client: setSecret / GetParameterCommand
Client->>SSM: Update / Retrieve parameter
SSM-->>Client: Parameter value
Client-->>Runner: Assertion
end
Runner->>Container: Stop LocalStack (afterAll)
Container-->>Runner: Stopped
else
Runner->>Runner: Skip integration tests
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
tests/envilder/infrastructure/aws/AwsSsmSecretProvider.test.ts (1)
151-153: Consider adding explicit region to SSM client configuration.The SSM client is created with only the endpoint. While LocalStack typically accepts connections without explicit region, adding a region prevents reliance on environment defaults and avoids potential SDK warnings.
🔧 Suggested improvement
ssmClient = new SSM({ endpoint, + region: 'us-east-1', });🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@tests/envilder/infrastructure/aws/AwsSsmSecretProvider.test.ts` around lines 151 - 153, SSM client is instantiated without an explicit region which can cause SDK warnings; update the SSM constructor call that assigns ssmClient to include a region field (e.g., region: "us-east-1" or a test-appropriate constant) alongside endpoint so the SSM({ endpoint }) becomes SSM({ endpoint, region: "<region>" }) in AwsSsmSecretProvider.test.ts where ssmClient is created.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@tests/envilder/infrastructure/aws/AwsSsmSecretProvider.test.ts`:
- Around line 151-153: SSM client is instantiated without an explicit region
which can cause SDK warnings; update the SSM constructor call that assigns
ssmClient to include a region field (e.g., region: "us-east-1" or a
test-appropriate constant) alongside endpoint so the SSM({ endpoint }) becomes
SSM({ endpoint, region: "<region>" }) in AwsSsmSecretProvider.test.ts where
ssmClient is created.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: fb0b07ae-1529-4ff9-a248-7b27b14efe05
⛔ Files ignored due to path filters (20)
.github/agents/code-review.agent.mdis excluded by none and included by none.github/agents/document-maintainer.agent.mdis excluded by none and included by none.github/agents/pr-comment-resolver.agent.mdis excluded by none and included by none.github/copilot-instructions.mdis excluded by none and included by none.github/hooks/block-push-on-requested-changes.jsonis excluded by none and included by none.github/hooks/pre-push-quality-gate.jsonis excluded by none and included by none.github/hooks/scripts/block-push-on-requested-changes.mjsis excluded by none and included by none.github/hooks/scripts/pre-push-quality-gate.mjsis excluded by none and included by none.github/instructions/architecture-boundaries.instructions.mdis excluded by none and included by none.github/instructions/coding-and-testing-conventions.instructions.mdis excluded by none and included by none.github/instructions/git-conventions.instructions.mdis excluded by none and included by none.github/instructions/review-response.instructions.mdis excluded by none and included by none.github/prompts/resolve-pr-comments.prompt.mdis excluded by none and included by none.github/prompts/use-semantic-versioning.prompt.mdis excluded by none and included by none.github/skills/testing-conventions/SKILL.mdis excluded by none and included by none.github/workflows/codeql-analysis.ymlis excluded by none and included by none.markdownlint.jsonis excluded by none and included by nonegithub-action/dist/index.jsis excluded by!**/dist/**and included by nonepackage.jsonis excluded by none and included by nonevite.config.tsis excluded by none and included by none
📒 Files selected for processing (1)
tests/envilder/infrastructure/aws/AwsSsmSecretProvider.test.ts
…m/macalbert/envilder into macalbert/add-ai-custom-workflows
… agents - Replace .github/hooks/ (Copilot PreToolUse) with lefthook pre-commit - Add 8 agents: code-reviewer, pr-feedback, tdd-coach, tdd-red/green/refactor, refactor, bug-hunter - Add 3 prompts: smart-commit, pr-sync, scaffold-feature - Strengthen AAA testing rule (each marker at most once per test) - Document AI workflows in docs/ai-workflows.md
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
docs/ai-workflows.md (1)
34-48: Align SDLC legend symbols with the diagram glyphsThe flow uses
···►in Line 34, but the legend in Lines 46-47 defines───/──►. Consider updating the legend to match the exact symbols shown in the diagram.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs/ai-workflows.md` around lines 34 - 48, The legend doesn't match the diagram glyphs: the diagram uses '···►' but the legend defines '───' for suggestion and '──►' for delegation; update the legend to match by replacing or adding the exact symbol used in the diagram (change '─── = suggestion (user invokes)' to '···► = suggestion (user invokes)' and ensure '──► = real delegation (automatic)' or add both variants if you intend to support both), and verify the text near the top that uses '···►' matches the legend symbol names exactly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@docs/ai-workflows.md`:
- Line 11: Make the documented pre-commit command consistent by choosing one
form and updating all occurrences: replace either "biome check --write" at line
11 or "biome check --write --unsafe" at lines 93-94 so every reference in the
doc uses the same command string; ensure the chosen command is reflected in any
surrounding explanatory text and examples that mention the pre-commit hook or
biome invocation.
---
Nitpick comments:
In `@docs/ai-workflows.md`:
- Around line 34-48: The legend doesn't match the diagram glyphs: the diagram
uses '···►' but the legend defines '───' for suggestion and '──►' for
delegation; update the legend to match by replacing or adding the exact symbol
used in the diagram (change '─── = suggestion (user invokes)' to '···► =
suggestion (user invokes)' and ensure '──► = real delegation (automatic)' or add
both variants if you intend to support both), and verify the text near the top
that uses '···►' matches the legend symbol names exactly.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: fae5058d-6c70-4150-8438-b430caf18f53
⛔ Files ignored due to path filters (18)
.github/agents/bug-hunter.agent.mdis excluded by none and included by none.github/agents/code-reviewer.agent.mdis excluded by none and included by none.github/agents/pr-feedback.agent.mdis excluded by none and included by none.github/agents/refactor.agent.mdis excluded by none and included by none.github/agents/tdd-coach.agent.mdis excluded by none and included by none.github/agents/tdd-green.agent.mdis excluded by none and included by none.github/agents/tdd-red.agent.mdis excluded by none and included by none.github/agents/tdd-refactor.agent.mdis excluded by none and included by none.github/copilot-instructions.mdis excluded by none and included by none.github/instructions/architecture-boundaries.instructions.mdis excluded by none and included by none.github/instructions/coding-and-testing-conventions.instructions.mdis excluded by none and included by none.github/prompts/pr-sync.prompt.mdis excluded by none and included by none.github/prompts/scaffold-feature.prompt.mdis excluded by none and included by none.github/prompts/smart-commit.prompt.mdis excluded by none and included by none.github/skills/testing-conventions/SKILL.mdis excluded by none and included by nonelefthook.ymlis excluded by none and included by nonepackage.jsonis excluded by none and included by nonepnpm-lock.yamlis excluded by!**/pnpm-lock.yamland included by none
📒 Files selected for processing (1)
docs/ai-workflows.md
| ```text | ||
| ┌─────────────────────────────────────────────────────┐ | ||
| │ Hooks (lefthook) │ | ||
| │ pre-commit → biome check --write on staged files │ |
There was a problem hiding this comment.
Inconsistent pre-commit command documentation
Line 11 documents biome check --write, while Lines 93-94 document biome check --write --unsafe. Please make this consistent so contributors don’t run the wrong mode.
Also applies to: 93-94
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@docs/ai-workflows.md` at line 11, Make the documented pre-commit command
consistent by choosing one form and updating all occurrences: replace either
"biome check --write" at line 11 or "biome check --write --unsafe" at lines
93-94 so every reference in the doc uses the same command string; ensure the
chosen command is reflected in any surrounding explanatory text and examples
that mention the pre-commit hook or biome invocation.
| globals: true, | ||
| environment: 'node', | ||
| include: ['**/*.test.ts'], | ||
| exclude: ['e2e/**', 'node_modules/**'], |
There was a problem hiding this comment.
🔴 pnpm test:e2e silently runs zero tests due to vitest exclude config
The new vite.config.ts:8 adds exclude: ['e2e/**', 'node_modules/**'] to prevent e2e tests from running during pnpm test. However, the new pnpm test:e2e script (package.json:32) runs vitest run --reporter=verbose e2e/, where e2e/ is a CLI filename filter. Vitest first collects test files using include/exclude from the config, then applies the CLI filter. Since e2e/** is excluded during collection, there are no candidate files for the e2e/ filter to match, so pnpm test:e2e completes successfully with zero tests executed — a silent failure.
Fix options
Either create a separate vitest config for e2e (e.g. vitest.e2e.config.ts) and reference it via vitest run --config vitest.e2e.config.ts, or keep the e2e tests included in the main config and use a different mechanism (like the describe.runIf guard already used elsewhere) to skip them during pnpm test.
Prompt for agents
The exclude for e2e in vite.config.ts (line 8) conflicts with the test:e2e script in package.json (line 32). Vitest applies exclude before the CLI filter argument, so pnpm test:e2e finds 0 tests.
Recommended fix: Create a separate vitest config for e2e tests.
1. Create a new file vitest.e2e.config.ts with:
import { defineConfig } from 'vitest/config';
export default defineConfig({
test: {
globals: true,
environment: 'node',
include: ['e2e/**/*.test.ts'],
},
});
2. Update package.json line 32, the test:e2e script, to:
"test:e2e": "vitest run --reporter=verbose --config vitest.e2e.config.ts"
Was this helpful? React with 👍 or 👎 to provide feedback.
| parallel: true | ||
| commands: | ||
| biome: | ||
| glob: "*.{ts,tsx,js,jsx,json}" |
There was a problem hiding this comment.
🔴 Lefthook glob *.{ts,...} does not match files in subdirectories
The lefthook glob filter at lefthook.yml:5 uses "*.{ts,tsx,js,jsx,json}". Lefthook applies this glob against git-relative file paths (e.g., src/envilder/domain/Foo.ts) using doublestar.Match, where * does not match path separators. This means only root-level files (e.g., biome.json, tsconfig.json) pass the filter — staged files under src/, tests/, or any subdirectory are silently excluded from the biome pre-commit check, defeating the purpose of the hook.
| glob: "*.{ts,tsx,js,jsx,json}" | |
| glob: "**/*.{ts,tsx,js,jsx,json}" |
Was this helpful? React with 👍 or 👎 to provide feedback.
Summary
Add a complete AI-assisted development workflow system to Envilder. Replace Copilot hooks with lefthook pre-commit, import 9 agents (including TDD subagent pattern and bug-hunter coordinator), 5 prompts, scoped instructions, and a testing-conventions skill. Document the full SDLC cycle in
docs/ai-workflows.md.Changes
Architecture & Conventions
copilot-instructions.mdwith enforced single Act/Assert per testAgents (9 total)
code-reviewer— multi-perspective subagent review (correctness, architecture, security, conventions)pr-feedback— resolves PR review comments, delegates to bug-hunter for bugstdd-coach— orchestrates Red-Green-Refactor cycle via 3 worker subagentstdd-red/tdd-green/tdd-refactor— TDD phase workers (not user-invocable)refactor— code smell detection with SOLID-aligned improvementsbug-hunter— reproduces and fixes bugs via TDD delegationdocument-maintainer— keeps docs in sync with code changesPrompts (5 total)
smart-commit— conventional commit from staged diffpr-sync— create/update PR via gh CLIscaffold-feature— hexagonal architecture file skeletonresolve-pr-comments— PR review feedback handleruse-semantic-versioning— SemVer bump recommendationHooks
.github/hooks/(Copilot PreToolUse hooks)lefthook.ymlwith biome pre-commit hook (auto-format + auto-stage)preparescriptDocumentation
docs/ai-workflows.md— architecture diagram, SDLC cycle, agent/prompt tables, FAQTesting
pnpm testpasses (81 passed, 0 failed)pnpm lintpasses (Secretlint + Biome + tsc)Summary by CodeRabbit