Add 12 repository-specific custom coding agents#50
Conversation
Co-authored-by: Krosebrook <214532761+Krosebrook@users.noreply.github.com>
Co-authored-by: Krosebrook <214532761+Krosebrook@users.noreply.github.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c514a9151e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| - **Form example**: `src/components/auth/LoginForm.jsx` - React Hook Form + Zod | ||
| - **Dashboard widget**: `src/components/dashboard/EngagementWidget.jsx` - TanStack Query usage |
There was a problem hiding this comment.
Use existing files in codebase example list
The Examples from Codebase section points to src/components/auth/LoginForm.jsx and src/components/dashboard/EngagementWidget.jsx, but neither file exists in this repo (the auth folder currently contains only SSO components, and dashboard has no EngagementWidget). Because this agent is supposed to ground generated code in real project patterns, these dead references make the guidance non-actionable and can lead Copilot/users to produce imports and structures that fail immediately.
Useful? React with 👍 / 👎.
| - `src/hooks/use-mobile.js` - Simple custom hook example | ||
| - `src/components/activities/ActivityCard.jsx` - TanStack Query usage | ||
| - `src/components/dashboard/EngagementWidget.jsx` - Multiple hooks |
There was a problem hiding this comment.
Point hook reference files to valid paths
This reference list includes src/hooks/use-mobile.js and src/components/dashboard/EngagementWidget.jsx, but the hook file is actually use-mobile.jsx and there is no EngagementWidget component in src/components/dashboard. When contributors or agents follow this checklist, they cannot inspect the promised examples, which weakens the hook-fixing workflow and increases the chance of applying fixes without validated in-repo patterns.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
13 issues found across 14 files
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name=".github/agents/tanstack-query-expert.agent.md">
<violation number="1" location=".github/agents/tanstack-query-expert.agent.md:34">
P2: TanStack Query v5 renamed `cacheTime` to `gcTime`. The agent documentation still instructs users to set `cacheTime`, which is outdated for v5 and will mislead users. Update both examples to `gcTime` so they match v5.84.1 usage.</violation>
</file>
<file name=".github/agents/base44-function-builder.agent.md">
<violation number="1" location=".github/agents/base44-function-builder.agent.md:44">
P2: The Base44 function template references SDK 0.8.4 even though the document specifies 0.8.3 for this repo. This will cause mismatched guidance and can lead to using an unapproved SDK version.</violation>
</file>
<file name=".github/agents/gamification-expert.agent.md">
<violation number="1" location=".github/agents/gamification-expert.agent.md:112">
P3: The agent doc pins Base44 SDK 0.8.4, which conflicts with the repo’s stated 0.8.3 version. Align the example with the repo’s SDK version to avoid misleading guidance.</violation>
<violation number="2" location=".github/agents/gamification-expert.agent.md:494">
P2: The example uses an invalid import identifier (`canvas-confetti`) and then calls `confetti(...)`. Update the import to a valid identifier to avoid a broken code sample.</violation>
</file>
<file name=".github/agents/react-component-builder.agent.md">
<violation number="1" location=".github/agents/react-component-builder.agent.md:256">
P2: The “CORRECT” example calls `setState` during render, which can cause infinite re-render loops. Update the example to move the state update into an effect or event handler instead of the render body.</violation>
<violation number="2" location=".github/agents/react-component-builder.agent.md:306">
P3: Update the examples list to reference existing components; this path (and the dashboard widget listed below) doesn't exist in the repo, so the guidance points to dead files.</violation>
</file>
<file name=".github/agents/security-auditor.agent.md">
<violation number="1" location=".github/agents/security-auditor.agent.md:181">
P2: Avoid using real-looking API key formats in documentation examples; they can trigger secret scanners and propagate insecure patterns. Use clearly redacted placeholders instead.</violation>
</file>
<file name=".github/agents/README.md">
<violation number="1" location=".github/agents/README.md:350">
P3: The link points to `AGENTS.md`, but that file does not exist in the repository, so the documentation link is broken. Remove the link or update it to an existing document.</violation>
</file>
<file name=".github/agents/documentation-writer.agent.md">
<violation number="1" location=".github/agents/documentation-writer.agent.md:100">
P3: The Markdown examples nest triple‑backtick fences inside an outer ```markdown block, which will close the outer fence and break the rendering of the example. Use a higher‑level fence (e.g., four backticks) or indent inner fences so the example renders correctly.</violation>
</file>
<file name=".github/agents/react-hooks-fixer.agent.md">
<violation number="1" location=".github/agents/react-hooks-fixer.agent.md:424">
P3: Use valid file paths in the reference list; the hook file uses a .jsx extension and the EngagementWidget component doesn't exist, so this checklist sends readers to dead links.</violation>
</file>
<file name=".github/agents/form-validation-expert.agent.md">
<violation number="1" location=".github/agents/form-validation-expert.agent.md:563">
P2: TanStack Query v5 removed `isLoading` from `useMutation`; use `isPending` instead. This example will fail against the repo’s v5 dependency.</violation>
</file>
<file name=".github/agents/ai-integration-specialist.agent.md">
<violation number="1" location=".github/agents/ai-integration-specialist.agent.md:414">
P2: `useMutation` in TanStack Query v5 exposes `isPending`, not `isLoading`. The agent example will cause runtime/TS errors when copied. Update the example to use `isPending` for the loading state.</violation>
</file>
<file name=".github/agents/code-quality-linter.agent.md">
<violation number="1" location=".github/agents/code-quality-linter.agent.md:204">
P2: The doc claims ESLint ignores `dist/` and `build/` by default, but ESLint’s default ignores are only `node_modules/` and `.git/`, and this repo doesn’t configure ignores for `dist/` or `build/`. This misstates lint scope.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| defaultOptions: { | ||
| queries: { | ||
| staleTime: 5 * 60 * 1000, // 5 minutes | ||
| cacheTime: 10 * 60 * 1000, // 10 minutes |
There was a problem hiding this comment.
P2: TanStack Query v5 renamed cacheTime to gcTime. The agent documentation still instructs users to set cacheTime, which is outdated for v5 and will mislead users. Update both examples to gcTime so they match v5.84.1 usage.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/agents/tanstack-query-expert.agent.md, line 34:
<comment>TanStack Query v5 renamed `cacheTime` to `gcTime`. The agent documentation still instructs users to set `cacheTime`, which is outdated for v5 and will mislead users. Update both examples to `gcTime` so they match v5.84.1 usage.</comment>
<file context>
@@ -0,0 +1,646 @@
+ defaultOptions: {
+ queries: {
+ staleTime: 5 * 60 * 1000, // 5 minutes
+ cacheTime: 10 * 60 * 1000, // 10 minutes
+ retry: 1,
+ refetchOnWindowFocus: false,
</file context>
| ALWAYS use this pattern for new functions: | ||
|
|
||
| ```typescript | ||
| import { createClientFromRequest } from 'npm:@base44/sdk@0.8.4'; |
There was a problem hiding this comment.
P2: The Base44 function template references SDK 0.8.4 even though the document specifies 0.8.3 for this repo. This will cause mismatched guidance and can lead to using an unapproved SDK version.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/agents/base44-function-builder.agent.md, line 44:
<comment>The Base44 function template references SDK 0.8.4 even though the document specifies 0.8.3 for this repo. This will cause mismatched guidance and can lead to using an unapproved SDK version.</comment>
<file context>
@@ -0,0 +1,563 @@
+ALWAYS use this pattern for new functions:
+
+```typescript
+import { createClientFromRequest } from 'npm:@base44/sdk@0.8.4';
+
+/**
</file context>
|
|
||
| ```javascript | ||
| import { motion } from 'framer-motion'; | ||
| import canvas-confetti from 'canvas-confetti'; |
There was a problem hiding this comment.
P2: The example uses an invalid import identifier (canvas-confetti) and then calls confetti(...). Update the import to a valid identifier to avoid a broken code sample.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/agents/gamification-expert.agent.md, line 494:
<comment>The example uses an invalid import identifier (`canvas-confetti`) and then calls `confetti(...)`. Update the import to a valid identifier to avoid a broken code sample.</comment>
<file context>
@@ -0,0 +1,606 @@
+
+```javascript
+import { motion } from 'framer-motion';
+import canvas-confetti from 'canvas-confetti';
+
+function BadgeUnlockedAnimation({ badge, onClose }) {
</file context>
| ❌ **NEVER** call hooks conditionally or in loops: | ||
| ```javascript | ||
| // WRONG | ||
| if (condition) { |
There was a problem hiding this comment.
P2: The “CORRECT” example calls setState during render, which can cause infinite re-render loops. Update the example to move the state update into an effect or event handler instead of the render body.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/agents/react-component-builder.agent.md, line 256:
<comment>The “CORRECT” example calls `setState` during render, which can cause infinite re-render loops. Update the example to move the state update into an effect or event handler instead of the render body.</comment>
<file context>
@@ -0,0 +1,331 @@
+❌ **NEVER** call hooks conditionally or in loops:
+```javascript
+// WRONG
+if (condition) {
+ const [state, setState] = useState(null); // ❌
+}
</file context>
| **❌ NEVER hardcode secrets:** | ||
| ```javascript | ||
| // ❌ WRONG - Exposed secret | ||
| const API_KEY = 'sk-1234567890abcdef'; // Never do this |
There was a problem hiding this comment.
P2: Avoid using real-looking API key formats in documentation examples; they can trigger secret scanners and propagate insecure patterns. Use clearly redacted placeholders instead.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/agents/security-auditor.agent.md, line 181:
<comment>Avoid using real-looking API key formats in documentation examples; they can trigger secret scanners and propagate insecure patterns. Use clearly redacted placeholders instead.</comment>
<file context>
@@ -0,0 +1,490 @@
+**❌ NEVER hardcode secrets:**
+```javascript
+// ❌ WRONG - Exposed secret
+const API_KEY = 'sk-1234567890abcdef'; // Never do this
+const STRIPE_KEY = 'pk_live_xxxxx'; // Never in frontend
+```
</file context>
|
|
||
| Backend function (`functions/awardPoints.ts`): | ||
| ```typescript | ||
| import { createClientFromRequest } from 'npm:@base44/sdk@0.8.4'; |
There was a problem hiding this comment.
P3: The agent doc pins Base44 SDK 0.8.4, which conflicts with the repo’s stated 0.8.3 version. Align the example with the repo’s SDK version to avoid misleading guidance.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/agents/gamification-expert.agent.md, line 112:
<comment>The agent doc pins Base44 SDK 0.8.4, which conflicts with the repo’s stated 0.8.3 version. Align the example with the repo’s SDK version to avoid misleading guidance.</comment>
<file context>
@@ -0,0 +1,606 @@
+
+Backend function (`functions/awardPoints.ts`):
+```typescript
+import { createClientFromRequest } from 'npm:@base44/sdk@0.8.4';
+
+Deno.serve(async (req) => {
</file context>
| Reference these existing components for patterns: | ||
|
|
||
| - **Card component**: `src/components/activities/ActivityCard.jsx` - Data display, mutations, animations | ||
| - **Form example**: `src/components/auth/LoginForm.jsx` - React Hook Form + Zod |
There was a problem hiding this comment.
P3: Update the examples list to reference existing components; this path (and the dashboard widget listed below) doesn't exist in the repo, so the guidance points to dead files.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/agents/react-component-builder.agent.md, line 306:
<comment>Update the examples list to reference existing components; this path (and the dashboard widget listed below) doesn't exist in the repo, so the guidance points to dead files.</comment>
<file context>
@@ -0,0 +1,331 @@
+Reference these existing components for patterns:
+
+- **Card component**: `src/components/activities/ActivityCard.jsx` - Data display, mutations, animations
+- **Form example**: `src/components/auth/LoginForm.jsx` - React Hook Form + Zod
+- **Dashboard widget**: `src/components/dashboard/EngagementWidget.jsx` - TanStack Query usage
+- **UI primitives**: `src/components/ui/button.jsx`, `src/components/ui/card.jsx` - Radix patterns
</file context>
| --- | ||
|
|
||
| **Maintained by:** Krosebrook | ||
| **Questions?** Create an issue or refer to [AGENTS.md](../../AGENTS.md) |
There was a problem hiding this comment.
P3: The link points to AGENTS.md, but that file does not exist in the repository, so the documentation link is broken. Remove the link or update it to an existing document.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/agents/README.md, line 350:
<comment>The link points to `AGENTS.md`, but that file does not exist in the repository, so the documentation link is broken. Remove the link or update it to an existing document.</comment>
<file context>
@@ -0,0 +1,350 @@
+---
+
+**Maintained by:** Krosebrook
+**Questions?** Create an issue or refer to [AGENTS.md](../../AGENTS.md)
</file context>
| Document API endpoints and functions: | ||
|
|
||
| ```markdown | ||
| ## Function: awardPoints |
There was a problem hiding this comment.
P3: The Markdown examples nest triple‑backtick fences inside an outer ```markdown block, which will close the outer fence and break the rendering of the example. Use a higher‑level fence (e.g., four backticks) or indent inner fences so the example renders correctly.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/agents/documentation-writer.agent.md, line 100:
<comment>The Markdown examples nest triple‑backtick fences inside an outer ```markdown block, which will close the outer fence and break the rendering of the example. Use a higher‑level fence (e.g., four backticks) or indent inner fences so the example renders correctly.</comment>
<file context>
@@ -0,0 +1,503 @@
+Document API endpoints and functions:
+
+```markdown
+## Function: awardPoints
+
+**Location:** `functions/awardPoints.ts`
</file context>
| ## Reference Files | ||
|
|
||
| Check these files for correct hook usage: | ||
| - `src/hooks/use-mobile.js` - Simple custom hook example |
There was a problem hiding this comment.
P3: Use valid file paths in the reference list; the hook file uses a .jsx extension and the EngagementWidget component doesn't exist, so this checklist sends readers to dead links.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/agents/react-hooks-fixer.agent.md, line 424:
<comment>Use valid file paths in the reference list; the hook file uses a .jsx extension and the EngagementWidget component doesn't exist, so this checklist sends readers to dead links.</comment>
<file context>
@@ -0,0 +1,466 @@
+## Reference Files
+
+Check these files for correct hook usage:
+- `src/hooks/use-mobile.js` - Simple custom hook example
+- `src/components/activities/ActivityCard.jsx` - TanStack Query usage
+- `src/components/dashboard/EngagementWidget.jsx` - Multiple hooks
</file context>
Generated specialized coding agents by analyzing the Interact platform's architecture, patterns, and conventions. Each agent references actual file paths and patterns from this repository rather than generic best practices.
Agents Created (12)
Frontend (4)
react-component-builder- Radix UI + TailwindCSS + TanStack Query patternsreact-hooks-fixer- Addresses 2 critical hooks violations in codebaseform-validation-expert- React Hook Form + Zod validationtanstack-query-expert- Data fetching, caching, optimistic updatesBackend (2)
base44-function-builder- Base44 SDK 0.8.3 serverless functionsai-integration-specialist- OpenAI GPT-4, Claude 3, Gemini ProDomain (1)
gamification-expert- Points, badges, leaderboards, challengesQuality (3)
test-writer- Vitest + RTL (target: 0.09% → 30% coverage)code-quality-linter- Fixes 100+ ESLint errorssecurity-auditor- Maintains 100/100 security scoreOps (2)
documentation-writer- Maintains 98/100 doc scorecicd-pipeline-manager- GitHub Actions workflow managementExample: React Component Builder
Agent Quality
Each agent includes:
src/components/activities/,functions/awardPoints.ts)cn()from@/lib/utils,base44from@/api/base44Client)Files
Total: 6,596 lines of agent documentation
Original prompt
Auto-Generate Repository Custom Agents
Objective
Analyze this entire repository — its stack, architecture, file structure, patterns, dependencies, existing tests, CI/CD, and domain logic — then generate the top 10-15 most valuable custom coding agents as
.github/agents/*.agent.mdfiles.Phase 1: Repository Analysis
Before generating anything, perform a deep analysis. Identify:
Read these files if they exist to understand project context:
README.md,ARCHITECTURE.md,CONTRIBUTING.md,CLAUDE.md,AGENTS.mdpackage.json/requirements.txt/go.mod/Cargo.toml/Gemfile(dependency manifest)tsconfig.json/vite.config.*/next.config.*/webpack.config.*(build config).github/workflows/*.yml(CI/CD).github/copilot-instructions.md(existing instructions)Phase 2: Agent Selection Criteria
Select agents based on these priorities (highest first):
Do NOT generate generic agents. Every agent must reference actual file paths, actual patterns, and actual conventions found in THIS repository.
Phase 3: Generate Agent Files
For each agent, create a file at
.github/agents/{agent-name}.agent.mdusing this format:Required Agent Categories
Generate agents from THESE categories, selecting whichever 10-15 are most relevant to this specific repo. Skip categories that don't apply.
Code Quality & Standards
anytypes, adds missing interfacesTesting
Feature Development
Infrastructure & DevOps
#...
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.
Summary by cubic
Generated 12 custom coding agent specs, an agents README, and a Copilot setup file to make Copilot context-aware for our stack and workflows. This streamlines common dev tasks and reduces review churn.
New Features
Migration
Written for commit c514a91. Summary will update on new commits.