codehava-agent-kit 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/cli.js +1 -0
- package/package.json +1 -1
- package/templates/.agent/AGENTS_INDEX.md +26 -0
- package/templates/.agent/SKILLS_INDEX.md +56 -0
- package/templates/.agent/agents/ai-engineer.md +29 -0
- package/templates/.agent/agents/ui-ux-designer.md +27 -0
- package/templates/.agent/skills/drizzle-orm-patterns/SKILL.md +90 -0
- package/templates/.agent/skills/feature-spec-writer/SKILL.md +28 -9
- package/templates/.agent/skills/rag-vector-db/SKILL.md +67 -0
- package/templates/.agent/skills/vibe-prd/SKILL.md +14 -12
- package/templates/.agent/skills/vibe-research/SKILL.md +1 -1
- package/templates/.agent/skills/vibe-stitch-prompt/SKILL.md +67 -0
- package/templates/.agent/skills/vibe-techdesign/SKILL.md +1 -1
- package/templates/.agent/workflows/3l5w-debug.md +26 -0
- package/templates/.agent/workflows/new-feature.md +2 -2
- package/templates/.agent/workflows/ui-audit.md +29 -0
- package/templates/.antigravity/rules.md +19 -3
package/bin/cli.js
CHANGED
package/package.json
CHANGED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Master Agents Index
|
|
2
|
+
|
|
3
|
+
AI, whenever you are assigned a task, scan this list to determine which Agent Persona you should adopt. Read the full agent file at `templates/.agent/agents/<agent-name>.md` to load your persona BEFORE coding.
|
|
4
|
+
|
|
5
|
+
- **ai-engineer**: Expert in Large Language Models (LLMs), RAG pipelines, Vector Databases (Pinecone/pgvector), LangChain, and integrating OpenAI/Anthropic/Gemini APIs into production applications. Triggers on ai, llm, rag, vector, embedding, openai, gemini, prompt.
|
|
6
|
+
- **backend-specialist**: Expert backend architect for Node.js, Python, and modern serverless/edge systems. Use for API development, server-side logic, database integration, and security. Triggers on backend, server, api, endpoint, database, auth.
|
|
7
|
+
- **code-archaeologist**: Expert in legacy code, refactoring, and understanding undocumented systems. Use for reading messy code, reverse engineering, and modernization planning. Triggers on legacy, refactor, spaghetti code, analyze repo, explain codebase.
|
|
8
|
+
- **database-architect**: Expert database architect for schema design, query optimization, migrations, and modern serverless databases. Use for database operations, schema changes, indexing, and data modeling. Triggers on database, sql, schema, migration, query, postgres, index, table.
|
|
9
|
+
- **debugger**: Expert in systematic debugging, root cause analysis, and crash investigation. Use for complex bugs, production issues, performance problems, and error analysis. Triggers on bug, error, crash, not working, broken, investigate, fix.
|
|
10
|
+
- **devops-engineer**: Expert in deployment, server management, CI/CD, and production operations. CRITICAL - Use for deployment, server access, rollback, and production changes. HIGH RISK operations. Triggers on deploy, production, server, pm2, ssh, release, rollback, ci/cd.
|
|
11
|
+
- **documentation-writer**: Expert in technical documentation. Use ONLY when user explicitly requests documentation (README, API docs, changelog). DO NOT auto-invoke during normal development.
|
|
12
|
+
- **explorer-agent**: Advanced codebase discovery, deep architectural analysis, and proactive research agent. The eyes and ears of the framework. Use for initial audits, refactoring plans, and deep investigative tasks.
|
|
13
|
+
- **frontend-specialist**: Senior Frontend Architect who builds maintainable React/Next.js systems with performance-first mindset. Use when working on UI components, styling, state management, responsive design, or frontend architecture. Triggers on keywords like component, react, vue, ui, ux, css, tailwind, responsive.
|
|
14
|
+
- **game-developer**: Game development across all platforms (PC, Web, Mobile, VR/AR). Use when building games with Unity, Godot, Unreal, Phaser, Three.js, or any game engine. Covers game mechanics, multiplayer, optimization, 2D/3D graphics, and game design patterns.
|
|
15
|
+
- **mobile-developer**: Expert in React Native and Flutter mobile development. Use for cross-platform mobile apps, native features, and mobile-specific patterns. Triggers on mobile, react native, flutter, ios, android, app store, expo.
|
|
16
|
+
- **orchestrator**: Multi-agent coordination and task orchestration. Use when a task requires multiple perspectives, parallel analysis, or coordinated execution across different domains. Invoke this agent for complex tasks that benefit from security, backend, frontend, testing, and DevOps expertise combined.
|
|
17
|
+
- **penetration-tester**: Expert in offensive security, penetration testing, red team operations, and vulnerability exploitation. Use for security assessments, attack simulations, and finding exploitable vulnerabilities. Triggers on pentest, exploit, attack, hack, breach, pwn, redteam, offensive.
|
|
18
|
+
- **performance-optimizer**: Expert in performance optimization, profiling, Core Web Vitals, and bundle optimization. Use for improving speed, reducing bundle size, and optimizing runtime performance. Triggers on performance, optimize, speed, slow, memory, cpu, benchmark, lighthouse.
|
|
19
|
+
- **product-manager**: Expert in product requirements, user stories, and acceptance criteria. Use for defining features, clarifying ambiguity, and prioritizing work. Triggers on requirements, user story, acceptance criteria, product specs.
|
|
20
|
+
- **product-owner**: Strategic facilitator bridging business needs and technical execution. Expert in requirements elicitation, roadmap management, and backlog prioritization. Triggers on requirements, user story, backlog, MVP, PRD, stakeholder.
|
|
21
|
+
- **project-planner**: Smart project planning agent. Breaks down user requests into tasks, plans file structure, determines which agent does what, creates dependency graph. Use when starting new projects or planning major features.
|
|
22
|
+
- **qa-automation-engineer**: Specialist in test automation infrastructure and E2E testing. Focuses on Playwright, Cypress, CI pipelines, and breaking the system. Triggers on e2e, automated test, pipeline, playwright, cypress, regression.
|
|
23
|
+
- **security-auditor**: Elite cybersecurity expert. Think like an attacker, defend like an expert. OWASP 2025, supply chain security, zero trust architecture. Triggers on security, vulnerability, owasp, xss, injection, auth, encrypt, supply chain, pentest.
|
|
24
|
+
- **seo-specialist**: SEO and GEO (Generative Engine Optimization) expert. Handles SEO audits, Core Web Vitals, E-E-A-T optimization, AI search visibility. Use for SEO improvements, content optimization, or AI citation strategies.
|
|
25
|
+
- **test-engineer**: Expert in testing, TDD, and test automation. Use for writing tests, improving coverage, debugging test failures. Triggers on test, spec, coverage, jest, pytest, playwright, e2e, unit test.
|
|
26
|
+
- **ui-ux-designer**: Expert in UI/UX principles, WCAG accessibility, Figma translation, typography, spacing, color theory, and micro-interactions. Use for evaluating layouts, improving aesthetic vibes, and ensuring responsive design perfectness. Triggers on ui, ux, design, layout, aesthetic, color, spacing, figma.
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Master Skills Index
|
|
2
|
+
|
|
3
|
+
AI, whenever you are assigned a task, scan this list to find relevant skills. If a skill seems relevant to the task, read its full `SKILL.md` file located at `templates/.agent/skills/<skill-name>/SKILL.md` BEFORE coding.
|
|
4
|
+
|
|
5
|
+
- **api-patterns**: allowed-tools: Read, Write, Edit, Glob, Grep ---
|
|
6
|
+
- **app-builder**: allowed-tools: Read, Write, Edit, Glob, Grep, Bash, Agent ---
|
|
7
|
+
- **architecture**: allowed-tools: Read, Glob, Grep ---
|
|
8
|
+
- **bash-linux**: allowed-tools: Read, Write, Edit, Glob, Grep, Bash ---
|
|
9
|
+
- **behavioral-modes**: allowed-tools: Read, Glob, Grep ---
|
|
10
|
+
- **better-auth-patterns**: Use when implementing authentication, authorization, session management, login/register flows, Google OAuth, or protected routes. Triggers on
|
|
11
|
+
- **brainstorming**: allowed-tools: Read, Glob, Grep ---
|
|
12
|
+
- **bullmq-worker**: Use when creating background jobs, queues, workers, or scheduling tasks. Also use when connecting background job results to Socket.io realtime events
|
|
13
|
+
- **clean-code**: allowed-tools: Read, Write, Edit version: 2.0
|
|
14
|
+
- **code-review-checklist**: allowed-tools: Read, Glob, Grep ---
|
|
15
|
+
- **database-design**: allowed-tools: Read, Write, Edit, Glob, Grep ---
|
|
16
|
+
- **deployment-procedures**: allowed-tools: Read, Glob, Grep, Bash ---
|
|
17
|
+
- **documentation-templates**: allowed-tools: Read, Glob, Grep ---
|
|
18
|
+
- **drizzle-orm-patterns**: Use when writing Drizzle ORM database code, migrations, or schema design. Very useful for Edge and Serverless database environments like Turso, Neon, or Cloudflare D1. Triggers on drizzle, schema, migration, orm, query, insert, select, postgres, sqlite. ---
|
|
19
|
+
- **feature-spec-writer**: Use when planning a new feature before coding, creating a feature brief, or writing acceptance criteria. Triggers on "plan this feature", "write a spec",
|
|
20
|
+
- **frontend-design**: allowed-tools: Read, Write, Edit, Glob, Grep, Bash ---
|
|
21
|
+
- **game-development**: allowed-tools: Read, Write, Edit, Glob, Grep, Bash ---
|
|
22
|
+
- **geo-fundamentals**: allowed-tools: Read, Glob, Grep ---
|
|
23
|
+
- **i18n-localization**: allowed-tools: Read, Glob, Grep ---
|
|
24
|
+
- **intelligent-routing**: version: 1.0.0 ---
|
|
25
|
+
- **lint-and-validate**: allowed-tools: Read, Glob, Grep, Bash ---
|
|
26
|
+
- **mcp-builder**: allowed-tools: Read, Write, Edit, Glob, Grep ---
|
|
27
|
+
- **mobile-design**: allowed-tools: Read, Glob, Grep, Bash ---
|
|
28
|
+
- **neo-storage**: Use when uploading, downloading, deleting files, or generating presigned URLs with NEO Object Storage (Biznet Gio). Triggers on "upload file", "object storage",
|
|
29
|
+
- **nextjs-api-route**: Use when creating or modifying Next.js App Router API routes (route.ts files), Server Actions, or Server Components that fetch data. Triggers on "api route",
|
|
30
|
+
- **nextjs-react-expert**: allowed-tools: Read, Write, Edit, Glob, Grep, Bash ---
|
|
31
|
+
- **nodejs-best-practices**: allowed-tools: Read, Write, Edit, Glob, Grep ---
|
|
32
|
+
- **parallel-agents**: allowed-tools: Read, Glob, Grep ---
|
|
33
|
+
- **performance-profiling**: allowed-tools: Read, Glob, Grep, Bash ---
|
|
34
|
+
- **plan-writing**: allowed-tools: Read, Glob, Grep ---
|
|
35
|
+
- **powershell-windows**: allowed-tools: Read, Write, Edit, Glob, Grep, Bash ---
|
|
36
|
+
- **prisma-7-patterns**: Use when writing ANY Prisma database code, creating models, running queries, setting up the Prisma client, or running migrations. Triggers on "prisma",
|
|
37
|
+
- **python-patterns**: allowed-tools: Read, Write, Edit, Glob, Grep ---
|
|
38
|
+
- **rag-vector-db**: Use when building AI applications that require memory, semantic search, embeddings, document chat, or connecting an LLM to a private dataset (RAG). Triggers on rag, vector, embedding, pinecone, qdrant, pgvector, similarity search. ---
|
|
39
|
+
- **red-team-tactics**: allowed-tools: Read, Glob, Grep ---
|
|
40
|
+
- **rust-pro**: features, and production-ready systems programming. Expert in the latest Rust ecosystem including Tokio, axum, and cutting-edge crates. Use PROACTIVELY for
|
|
41
|
+
- **seo-fundamentals**: allowed-tools: Read, Glob, Grep ---
|
|
42
|
+
- **server-management**: allowed-tools: Read, Write, Edit, Glob, Grep, Bash ---
|
|
43
|
+
- **systematic-debugging**: allowed-tools: Read, Glob, Grep ---
|
|
44
|
+
- **tailwind-patterns**: allowed-tools: Read, Write, Edit, Glob, Grep ---
|
|
45
|
+
- **tdd-workflow**: allowed-tools: Read, Write, Edit, Glob, Grep, Bash ---
|
|
46
|
+
- **testing-patterns**: allowed-tools: Read, Write, Edit, Glob, Grep, Bash ---
|
|
47
|
+
- **uu-pdp-feature-check**: Use when building any feature that collects, stores, displays, or processes user personal data. Triggers on "user data", "personal info", "profile",
|
|
48
|
+
- **vibe-buildplan**: Use after vibe-techdesign. Generates sprint plan and initial backlog from PRD. Triggers on "buat sprint plan", "breakdown task", "berapa sprint",
|
|
49
|
+
- **vibe-prd**: Use after vibe-research, or when starting to define product requirements. Triggers on "buat PRD", "definisikan fitur", "apa yang harus dibangun",
|
|
50
|
+
- **vibe-research**: Use at the START of a new project, before PRD or coding. Triggers on "riset aplikasi ini", "research dulu", "validasi ide",
|
|
51
|
+
- **vibe-stitch-prompt**: Use when the user wants to generate a UI design prompt for Google Stitch based on the existing PRD and UI Guidelines. Triggers on "buat prompt stitch",
|
|
52
|
+
- **vibe-techdesign**: Use after vibe-prd, or when deciding architecture and stack. Triggers on "pilih stack", "desain arsitektur", "database apa yang cocok",
|
|
53
|
+
- **vulnerability-scanner**: allowed-tools: Read, Glob, Grep, Bash ---
|
|
54
|
+
- **web-design-guidelines**: metadata: author: vercel
|
|
55
|
+
- **webapp-testing**: allowed-tools: Read, Write, Edit, Glob, Grep, Bash ---
|
|
56
|
+
- **xendit-integration**: Use when working with Xendit payment integration: creating payment links, handling webhooks, implementing split payment, or managing disbursements.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ai-engineer
|
|
3
|
+
description: Expert in Large Language Models (LLMs), RAG pipelines, Vector Databases (Pinecone/pgvector), LangChain, and integrating OpenAI/Anthropic/Gemini APIs into production applications. Triggers on ai, llm, rag, vector, embedding, openai, gemini, prompt.
|
|
4
|
+
tools: Read, Grep, Glob, Bash, Edit, Write
|
|
5
|
+
model: inherit
|
|
6
|
+
skills: rag-vector-db, api-patterns, python-patterns, nodejs-best-practices
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# AI Engineer & LLM Operations Expert
|
|
10
|
+
|
|
11
|
+
You are an AI Engineer specializing in integrating Large Language Models (LLMs) into production architectures. You build reliable, cost-effective, and safe AI features.
|
|
12
|
+
|
|
13
|
+
## Your Expertise
|
|
14
|
+
- **RAG (Retrieval-Augmented Generation):** Semantic search, chunking strategies, embeddings.
|
|
15
|
+
- **Vector Databases:** pgvector, Pinecone, Qdrant, ChromaDB.
|
|
16
|
+
- **LLM APIs:** OpenAI, Anthropic Claude, Google Gemini, Groq.
|
|
17
|
+
- **Frameworks:** LangChain, LlamaIndex, Vercel AI SDK.
|
|
18
|
+
- **Prompt Engineering:** Few-shot, chain-of-thought, defense against prompt injection.
|
|
19
|
+
|
|
20
|
+
## Your Philosophy
|
|
21
|
+
- **Fallbacks are mandatory:** LLM APIs fail. Always implement exponential backoff and graceful UI degradation.
|
|
22
|
+
- **Latency is UX:** Stream responses whenever possible (e.g., Vercel AI SDK `streamText`).
|
|
23
|
+
- **Cost awareness:** Use smaller models (Flash/Haiku/Mini) for routing and standard NLP tasks, reserve large models (Pro/Opus) for complex reasoning.
|
|
24
|
+
- **Security:** Never pass raw user inputs to a database via an LLM. Defend against prompt injections (Jailbreaks).
|
|
25
|
+
|
|
26
|
+
## Core Directives
|
|
27
|
+
1. **Always suggest Streaming:** If building a chatbot or text generator, strictly recommend using streaming responses to reduce perceived latency.
|
|
28
|
+
2. **Context limits:** When implementing RAG, always calculate token limits and suggest truncation or strict top-K filtering.
|
|
29
|
+
3. **Structured Outputs:** When an LLM is used as an internal engine (not a chat), strictly enforce JSON responses using tools like Zod or OpenAI's `response_format: { type: "json_object" }`.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ui-ux-designer
|
|
3
|
+
description: Expert in UI/UX principles, WCAG accessibility, Figma translation, typography, spacing, color theory, and micro-interactions. Use for evaluating layouts, improving aesthetic vibes, and ensuring responsive design perfectness. Triggers on ui, ux, design, layout, aesthetic, color, spacing, figma.
|
|
4
|
+
tools: Read, Grep, Glob, Bash, Edit, Write
|
|
5
|
+
model: inherit
|
|
6
|
+
skills: frontend-design, tailwind-patterns, web-design-guidelines
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# UI/UX Design Architect
|
|
10
|
+
|
|
11
|
+
You are a UI/UX Design Architect. Your role is not just to build interfaces, but to ensure they feel premium, intuitive, and accessible. You bridge the gap between static Figma designs and fluid, interactive code.
|
|
12
|
+
|
|
13
|
+
## Your Focus Areas
|
|
14
|
+
- **Visual Hierarchy:** Typography scales, whitespace (breathable padding/margins), and focal points.
|
|
15
|
+
- **Color Theory:** Contrast ratios, dark mode semantics, subtle gradients, and semantic colors (danger vs warning).
|
|
16
|
+
- **Accessibility (A11y):** WCAG 2.1 AA compliance, ARIA roles, keyboard navigation, and screen-reader friendly markup.
|
|
17
|
+
- **Micro-interactions:** Hover states, active states, focus rings, and skeleton loaders.
|
|
18
|
+
|
|
19
|
+
## Your Philosophy
|
|
20
|
+
- **Padding is power:** Interfaces need space to breathe. Avoid cramped elements.
|
|
21
|
+
- **Consistency:** Never use magic numbers for spacing (e.g. `mt-[17px]`). Stick to the Tailwind scale (e.g. `mt-4`).
|
|
22
|
+
- **Feedback:** Every user action must have immediate visual feedback (loading spinners, success toasts).
|
|
23
|
+
|
|
24
|
+
## Development Directives
|
|
25
|
+
1. **4 Fundamental States:** When asked to review or build a component, ALWAYS check if it has addressed the 4 states: *Blank/Empty, Loading, Error, and Success (Data)*.
|
|
26
|
+
2. **Responsiveness First:** Never assume desktop. Always build mobile-first components.
|
|
27
|
+
3. **Contrast Verification:** Ensure text on background has at least a 4.5:1 contrast ratio.
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: drizzle-orm-patterns
|
|
3
|
+
description: |
|
|
4
|
+
Use when writing Drizzle ORM database code, migrations, or schema design. Very useful for Edge and Serverless database environments like Turso, Neon, or Cloudflare D1. Triggers on drizzle, schema, migration, orm, query, insert, select, postgres, sqlite.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Drizzle ORM Patterns (2025)
|
|
8
|
+
|
|
9
|
+
## Mental Model
|
|
10
|
+
Drizzle is lightweight, TypeScript-first, and heavily Edge-compatible. Unlike Prisma which runs a Rust query engine, Drizzle translates TS directly into SQL, making it extremely fast for serverless (Hono, Vercel Edge).
|
|
11
|
+
|
|
12
|
+
## 1. Schema Definition (PostgreSQL example)
|
|
13
|
+
|
|
14
|
+
```typescript
|
|
15
|
+
import { pgTable, serial, text, varchar, timestamp, boolean } from 'drizzle-orm/pg-core';
|
|
16
|
+
import { relations } from 'drizzle-orm';
|
|
17
|
+
|
|
18
|
+
export const users = pgTable('users', {
|
|
19
|
+
id: serial('id').primaryKey(),
|
|
20
|
+
email: varchar('email', { length: 255 }).notNull().unique(),
|
|
21
|
+
name: text('name'),
|
|
22
|
+
isActive: boolean('is_active').default(true),
|
|
23
|
+
createdAt: timestamp('created_at').defaultNow().notNull(),
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
export const posts = pgTable('posts', {
|
|
27
|
+
id: serial('id').primaryKey(),
|
|
28
|
+
authorId: serial('author_id').references(() => users.id),
|
|
29
|
+
title: text('title').notNull(),
|
|
30
|
+
content: text('content'),
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
// Relations for Relational Queries (drizzle.query.findMany)
|
|
34
|
+
export const usersRelations = relations(users, ({ many }) => ({
|
|
35
|
+
posts: many(posts),
|
|
36
|
+
}));
|
|
37
|
+
|
|
38
|
+
export const postsRelations = relations(posts, ({ one }) => ({
|
|
39
|
+
author: one(users, {
|
|
40
|
+
fields: [posts.authorId],
|
|
41
|
+
references: [users.id],
|
|
42
|
+
}),
|
|
43
|
+
}));
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## 2. Advanced Queries
|
|
47
|
+
|
|
48
|
+
### Selection (Relational API vs SQL-Like)
|
|
49
|
+
Always prefer SQL-like API (`db.select()`) for complex joins/aggregations. Use Relational API (`db.query.xyz`) for rapid nested fetching.
|
|
50
|
+
|
|
51
|
+
```typescript
|
|
52
|
+
// SQL-Like (Better for performance and aggregations)
|
|
53
|
+
import { eq, desc } from 'drizzle-orm';
|
|
54
|
+
const result = await db
|
|
55
|
+
.select({
|
|
56
|
+
id: users.id,
|
|
57
|
+
name: users.name,
|
|
58
|
+
postTitle: posts.title
|
|
59
|
+
})
|
|
60
|
+
.from(users)
|
|
61
|
+
.leftJoin(posts, eq(users.id, posts.authorId))
|
|
62
|
+
.where(eq(users.isActive, true))
|
|
63
|
+
.orderBy(desc(users.createdAt))
|
|
64
|
+
.limit(10);
|
|
65
|
+
|
|
66
|
+
// Relational API (Better for nested data ease)
|
|
67
|
+
const userWithPosts = await db.query.users.findFirst({
|
|
68
|
+
where: eq(users.id, 1),
|
|
69
|
+
with: {
|
|
70
|
+
posts: {
|
|
71
|
+
limit: 5
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## 3. Transactions
|
|
78
|
+
Always use `.transaction()` when mutating multiple tables to ensure ACID compliance.
|
|
79
|
+
|
|
80
|
+
```typescript
|
|
81
|
+
await db.transaction(async (tx) => {
|
|
82
|
+
const [newUser] = await tx.insert(users).values({ email: 'x@x.com' }).returning();
|
|
83
|
+
await tx.insert(posts).values({ authorId: newUser.id, title: 'Welcome' });
|
|
84
|
+
});
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Anti-Patterns
|
|
88
|
+
1. ❌ Don't use `SELECT *` in production code. Always specify columns (`.select({ id: users.id })`).
|
|
89
|
+
2. ❌ Never string-concatenate SQL inside Drizzle. Always use `eq()`, `lt()`, `sql\`\`` tagged templates.
|
|
90
|
+
3. ❌ Don't forget to push migrations: `npx drizzle-kit push` for dev, or `npx drizzle-kit generate` for prod.
|
|
@@ -35,10 +35,24 @@ sebelum memulai implementasi fitur besar (size M atau L).
|
|
|
35
35
|
## Tujuan
|
|
36
36
|
[1-2 kalimat: masalah yang diselesaikan]
|
|
37
37
|
|
|
38
|
-
## Acceptance Criteria
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
- [ ]
|
|
38
|
+
## Acceptance Criteria (BDD Format)
|
|
39
|
+
> Wajib mendeskripsikan kriteria dengan format Given-When-Then.
|
|
40
|
+
|
|
41
|
+
- [ ] **Scenario 1 (Success Path):**
|
|
42
|
+
- **Given** [kondisi awal]
|
|
43
|
+
- **When** [trigger aksi]
|
|
44
|
+
- **Then** [hasil akhir / state UI / komponen yang dirender]
|
|
45
|
+
- [ ] **Scenario 2 (Error Handling):**
|
|
46
|
+
- **Given** [kondisi bermasalah, misal: server timeout]
|
|
47
|
+
- **When** [trigger aksi]
|
|
48
|
+
- **Then** [perilaku fallback / error boundary yang muncul]
|
|
49
|
+
|
|
50
|
+
## UX / UI States
|
|
51
|
+
Wajib definisikan tampilan untuk 4 kondisi ini:
|
|
52
|
+
- **Loading State:** [Bentuk skeleton / spinner]
|
|
53
|
+
- **Empty State:** [Tampilan jika tak ada data]
|
|
54
|
+
- **Error State:** [Tampilan retry / error boundary]
|
|
55
|
+
- **Success State:** [Data normal yang tampil]
|
|
42
56
|
|
|
43
57
|
## File yang Akan Diubah/Dibuat
|
|
44
58
|
- [ ] `app/(dashboard)/[path]/page.tsx` — [deskripsi perubahan]
|
|
@@ -46,11 +60,16 @@ sebelum memulai implementasi fitur besar (size M atau L).
|
|
|
46
60
|
- [ ] `lib/[module]/index.ts` — [helper baru]
|
|
47
61
|
- [ ] `prisma/schema.prisma` — [perubahan model jika ada]
|
|
48
62
|
|
|
49
|
-
## API Endpoints
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
|
53
|
-
|
|
63
|
+
## Data Contract / API Endpoints
|
|
64
|
+
*Tuliskan JSON Requests/Responses secara konkrit (Mockup JSON).*
|
|
65
|
+
|
|
66
|
+
| Method | Path | Request JSON | Response JSON |
|
|
67
|
+
|--------|------|--------------|---------------|
|
|
68
|
+
| POST | /api/[x] | `{ "field": "string" }` | `200 OK`: `{ "data": {...} }` |
|
|
69
|
+
|
|
70
|
+
## Edge Cases & Mitigasi Taktis
|
|
71
|
+
- **Skenario Terburuk:** [Misal user spam klik]
|
|
72
|
+
- **Mitigasi:** [Misal disable button dan debounce API]
|
|
54
73
|
|
|
55
74
|
## Perubahan Database
|
|
56
75
|
[Jika ada — describe schema changes]
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: rag-vector-db
|
|
3
|
+
description: |
|
|
4
|
+
Use when building AI applications that require memory, semantic search, embeddings, document chat, or connecting an LLM to a private dataset (RAG). Triggers on rag, vector, embedding, pinecone, qdrant, pgvector, similarity search.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# RAG & Vector Database Patterns
|
|
8
|
+
|
|
9
|
+
## Mental Model
|
|
10
|
+
RAG (Retrieval-Augmented Generation) prevents LLM hallucinations by forcing the AI to strictly answer based on context you provide. Vector databases store text as mathematical arrays (embeddings), allowing "Semantic Search" (finding text with similar meaning, not just exact keywords).
|
|
11
|
+
|
|
12
|
+
## 1. The RAG Pipeline
|
|
13
|
+
1. **Document Loading:** Parse PDF/Markdown/Webpages.
|
|
14
|
+
2. **Chunking:** Split large text into smaller chunks (e.g., 500-1000 tokens) with overlap (e.g., 100 tokens). This preserves context.
|
|
15
|
+
3. **Embedding:** Use an embedding model (e.g., `text-embedding-3-small`) to convert chunks into vectors.
|
|
16
|
+
4. **Storage:** Save to a Vector DB (pgvector, Pinecone).
|
|
17
|
+
5. **Retrieval Search:** Embed user's query -> search DB for nearest neighbors (Cosine Similarity).
|
|
18
|
+
6. **Generation:** Pass top-K results to LLM (e.g., GPT-4o) alongside the user's prompt as "Context".
|
|
19
|
+
|
|
20
|
+
## 2. Chunking Best Practices (RecursiveCharacterTextSplitter)
|
|
21
|
+
Never blindly split strings by length. Split by natural boundaries: Paragraphs -> Sentences -> Words.
|
|
22
|
+
|
|
23
|
+
```typescript
|
|
24
|
+
import { RecursiveCharacterTextSplitter } from 'langchain/text_splitter';
|
|
25
|
+
|
|
26
|
+
const splitter = new RecursiveCharacterTextSplitter({
|
|
27
|
+
chunkSize: 500,
|
|
28
|
+
chunkOverlap: 50,
|
|
29
|
+
separators: ["\n\n", "\n", " ", ""], // Natural semantic splitting
|
|
30
|
+
});
|
|
31
|
+
const output = await splitter.createDocuments([longText]);
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## 3. Cosine Similarity Search (pgvector Example)
|
|
35
|
+
If using PostgreSQL (`pgvector`), querying similarities is a matter of calculating vector distances (`<=>` operator).
|
|
36
|
+
|
|
37
|
+
```typescript
|
|
38
|
+
import { cosineDistance, desc, gt, sql } from 'drizzle-orm';
|
|
39
|
+
import { embeddingsTable } from './schema';
|
|
40
|
+
|
|
41
|
+
// Convert user query to vector first
|
|
42
|
+
const userQueryVector = await generateEmbedding("How to reset password?");
|
|
43
|
+
|
|
44
|
+
// Search DB for semantic matches
|
|
45
|
+
const similarity = sql<number>`1 - (${cosineDistance(embeddingsTable.embedding, userQueryVector)})`;
|
|
46
|
+
const results = await db
|
|
47
|
+
.select({ name: embeddingsTable.content, similarity })
|
|
48
|
+
.from(embeddingsTable)
|
|
49
|
+
.where(gt(similarity, 0.75)) // Only highly relevant matches
|
|
50
|
+
.orderBy((t) => desc(t.similarity))
|
|
51
|
+
.limit(5);
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## 4. Prompting the LLM with Context
|
|
55
|
+
Always use a strict boundary to prevent prompt injection.
|
|
56
|
+
|
|
57
|
+
```text
|
|
58
|
+
You are a helpful support agent. Reply strictly based on the triple-quoted Context provided below.
|
|
59
|
+
If the answer is not in the context, say "I don't have this information." DO NOT hallucinate.
|
|
60
|
+
|
|
61
|
+
CONTEXT:
|
|
62
|
+
\"\"\"
|
|
63
|
+
{RETRIEVED_CHUNKS_STRING}
|
|
64
|
+
\"\"\"
|
|
65
|
+
|
|
66
|
+
User Query: {USER_QUESTION}
|
|
67
|
+
```
|
|
@@ -138,33 +138,35 @@ Generate PRD sekarang? (yes/no)
|
|
|
138
138
|
|
|
139
139
|
---
|
|
140
140
|
|
|
141
|
-
## 4. User Stories
|
|
141
|
+
## 4. User Stories & Acceptance Criteria
|
|
142
142
|
|
|
143
|
-
> Format: Sebagai [siapa], saya ingin [aksi], agar [tujuan].
|
|
143
|
+
> Format User Story: Sebagai [siapa], saya ingin [aksi], agar [tujuan].
|
|
144
|
+
> Format Acceptance Criteria: **Given-When-Then** (BDD Format)
|
|
144
145
|
> ID REQ-XXX untuk traceability ke backlog dan kode.
|
|
145
146
|
|
|
146
147
|
### [Nama Persona 1]
|
|
147
148
|
- [ ] **REQ-001** Sebagai [persona 1], saya ingin [aksi dari F01], agar [tujuan]
|
|
149
|
+
- **AC (Success):** Given [kondisi awal], When [aksi trigger], Then [hasil yang diharapkan]
|
|
150
|
+
- **AC (Error):** Given [kondisi salah], When [aksi], Then [pesan error]
|
|
151
|
+
- **UI States:** [Definisikan Loading, Empty, Error, Success State]
|
|
148
152
|
- [ ] **REQ-002** Sebagai [persona 1], saya ingin [aksi dari F02], agar [tujuan]
|
|
149
|
-
-
|
|
153
|
+
- *... (ulangi struktur AC di atas)*
|
|
150
154
|
|
|
151
155
|
### [Nama Persona 2]
|
|
152
156
|
- [ ] **REQ-010** Sebagai [persona 2], saya ingin [aksi], agar [tujuan]
|
|
153
|
-
-
|
|
157
|
+
- *... (ulangi struktur AC di atas)*
|
|
154
158
|
|
|
155
159
|
### Pembayaran (jika ada)
|
|
156
160
|
- [ ] **REQ-020** Sebagai pembeli, saya ingin membayar via [metode], agar transaksi mudah
|
|
157
|
-
- [ ] **REQ-021** Sebagai
|
|
158
|
-
- [ ] **REQ-022** Sebagai admin, saya ingin melihat semua transaksi, agar bisa rekonsiliasi
|
|
161
|
+
- [ ] **REQ-021** Sebagai admin, saya ingin melihat semua transaksi, agar bisa rekonsiliasi
|
|
159
162
|
|
|
160
|
-
### Notifikasi
|
|
161
|
-
- [ ] **REQ-030** Sebagai pengguna, saya ingin dapat notifikasi saat [event penting]
|
|
162
|
-
-
|
|
163
|
+
### Notifikasi & Edge Cases
|
|
164
|
+
- [ ] **REQ-030** Sebagai pengguna, saya ingin dapat notifikasi saat [event penting].
|
|
165
|
+
- **Edge Case Mitigasi:** Jika notifikasi gagal/API timeout, tampilkan di in-app notification fall-back.
|
|
163
166
|
|
|
164
167
|
### UU PDP — Hak Pengguna (Wajib)
|
|
165
168
|
- [ ] **REQ-040** Sebagai pengguna, saya ingin dapat menghapus akun dan semua data saya
|
|
166
|
-
- [ ] **REQ-041** Sebagai pengguna, saya ingin
|
|
167
|
-
- [ ] **REQ-042** Sebagai pengguna, saya ingin dapat mencabut consent marketing kapan saja
|
|
169
|
+
- [ ] **REQ-041** Sebagai pengguna, saya ingin mengunduh data pribadi saya
|
|
168
170
|
|
|
169
171
|
---
|
|
170
172
|
|
|
@@ -223,4 +225,4 @@ Generate PRD sekarang? (yes/no)
|
|
|
223
225
|
- Jika user menyebutkan fitur yang terlalu kompleks untuk MVP, masukkan ke P1 dan jelaskan kenapa
|
|
224
226
|
- Payment section: muncul hanya jika user konfirmasi ada transaksi keuangan
|
|
225
227
|
- **STRUKTUR DOKUMEN WAJIB**: Selaraskan dan lengkapi hierarki PRD yang dihasilkan dengan elemen-elemen profesional dari `docs/SRS-Template.md`.
|
|
226
|
-
- Setelah
|
|
228
|
+
- **SKILL CHAINING:** Setelah dokumen PRD selesai dibuat, JANGAN BERHENTI. Secara proaktif tanyakan kepada user: *"PRD sudah siap! Apakah Anda ingin saya langsung menentukan Arsitektur dan Tech Stack menggunakan skill **vibe-techdesign** sekarang?"* Jika user menjawab "Ya", kamu WAJIB secara mandiri berpindah dan mengeksekusi langkah-langkah di `vibe-techdesign`.
|
|
@@ -159,4 +159,4 @@ Generate dokumen dengan struktur berikut:
|
|
|
159
159
|
- Fokus pada konteks **Indonesia**: pasar lokal, payment local (Xendit/Midtrans), regulasi UU PDP
|
|
160
160
|
- Jika user belum menyebut kompetitor, suggest yang paling relevan berdasarkan deskripsi ide
|
|
161
161
|
- Estimasi angka harus realistis, bukan overly optimistic
|
|
162
|
-
- Setelah generate,
|
|
162
|
+
- **SKILL CHAINING:** Setelah riset selesai di-generate, JANGAN BERHENTI. Secara proaktif tanyakan kepada user: *"Apakah Anda ingin saya langsung melanjutkan menyusun dokumen PRD menggunakan skill **vibe-prd** sekarang?"* Jika user menjawab "Ya", kamu WAJIB secara mandiri menginisiasi skill `vibe-prd` tanpa menunggu perintah spesifik lagi.
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: vibe-stitch-prompt
|
|
3
|
+
description: |
|
|
4
|
+
Use when the user wants to generate a UI design prompt for Google Stitch
|
|
5
|
+
based on the existing PRD and UI Guidelines. Triggers on "buat prompt stitch",
|
|
6
|
+
"google stitch prompt", "generate desain ui", or "prompt figma/stitch".
|
|
7
|
+
Requires: docs/01-PRD.md (wajib baca).
|
|
8
|
+
Optional: docs/03-UI-GUIDELINES.md.
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Vibe Stitch Prompt Generator
|
|
12
|
+
|
|
13
|
+
Skill ini bertugas membaca dokumen PRD (`docs/01-PRD.md`) dan merangkumnya menjadi sebuah instruksi/prompt **Mega-Prompt** berbahasa Inggris (atau Indonesia baku) yang sangat optimal untuk di-copy-paste user ke **Google Stitch** (AI UI Generator).
|
|
14
|
+
|
|
15
|
+
## Langkah-Langkah AI:
|
|
16
|
+
|
|
17
|
+
1. **Baca Konteks:** Baca `docs/01-PRD.md` (terutama bagian Elevator Pitch, Target Pengguna, dan list Fitur MVP P0). Jika ada `docs/03-UI-GUIDELINES.md`, baca juga untuk mengambil referensi warna/tema.
|
|
18
|
+
2. **Ekstrak Data Utama:** Ambil struktur inti yang diperlukan oleh UI Generator:
|
|
19
|
+
- Nama Aplikasi & Tujuan Utama
|
|
20
|
+
- Vibe / Aesthetic (misal: "Modern, Minimalist, B2B SaaS, Dark Mode, High Contrast")
|
|
21
|
+
- Daftar Halaman/Screen Utama (berdasarkan fitur MVP P0)
|
|
22
|
+
- Komponen wajib (Tabel, Form, Dashboard, dsb)
|
|
23
|
+
3. **Format Prompt:** Hasilkan blok teks yang siap disalin oleh user.
|
|
24
|
+
|
|
25
|
+
## Template Output (Mega-Prompt untuk Google Stitch)
|
|
26
|
+
|
|
27
|
+
Berikan output kepada user dalam blok verbatim teks yang mudah di-copy, persis seperti ini:
|
|
28
|
+
|
|
29
|
+
```text
|
|
30
|
+
Act as an expert UI/UX Designer. Generate a high-fidelity, production-ready UI design system and screen layouts for my application called "[Nama Aplikasi]":
|
|
31
|
+
|
|
32
|
+
**Overview:**
|
|
33
|
+
[Elevator pitch dari PRD, 1-2 kalimat]
|
|
34
|
+
|
|
35
|
+
**Target Audience:**
|
|
36
|
+
[Ringkasan persona utama dari PRD]
|
|
37
|
+
|
|
38
|
+
**Design Theme & Vibe (Aesthetic):**
|
|
39
|
+
- Style: Modern, clean, professional [sesuaikan jika B2B/B2C/SaaS]
|
|
40
|
+
- Colors: [sebutkan primary color/brand jika ada, atau minta Stitch pilih yang harmonis]
|
|
41
|
+
- Typography: Highly readable sans-serif (e.g., Inter, Roboto, atau Plus Jakarta Sans)
|
|
42
|
+
- Radius & Spacing: [misal: Soft rounded corners, breathable padding]
|
|
43
|
+
- Vibe: Trustworthy, fast, intuitive, and accessible.
|
|
44
|
+
|
|
45
|
+
**Key Screens to Generate (MVP Scope):**
|
|
46
|
+
|
|
47
|
+
1. **[Nama Screen 1, misal: Main Dashboard]**
|
|
48
|
+
- Layout: [Sidebar / Top-nav]
|
|
49
|
+
- Must include: [List data point penting: metric cards, recent activity table, dll]
|
|
50
|
+
- Actions: [Call to Action Button yang harus ada]
|
|
51
|
+
- Focus: Provide the "Empty State" if no data is present, and the "Success State" with dummy data.
|
|
52
|
+
|
|
53
|
+
2. **[Nama Screen 2, misal: Transaction/Form Input]**
|
|
54
|
+
- Must include: [Input fields yang relevan]
|
|
55
|
+
- Focus: [Validasi visual / Clear visual hierarchy]
|
|
56
|
+
|
|
57
|
+
**Additional Constraints:**
|
|
58
|
+
- Ensure all screens use real-world descriptive dummy data (no "lorem ipsum").
|
|
59
|
+
- Ensure high contrast for accessibility (WCAG standard).
|
|
60
|
+
- Design for [Desktop / Mobile / Responsive] first.
|
|
61
|
+
- Provide a summary of all Design Tokens (Colors, Typography, Spacing hierarchy) in Markdown format so I can easily copy it to my engineering workspace.
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Aturan Penting Saat Menjalankan Skill:
|
|
65
|
+
- Pastikan variabel `[Nama Aplikasi]`, `[Nama Screen 1]`, dll **seluruhnya sudah tergantikan dengan fakta spesifik dari PRD Anda** (tidak boleh ada kurung siku `[ ... ]` yang tersisa).
|
|
66
|
+
- Prompt haruslah spesifik, tajam, dan siap pakai.
|
|
67
|
+
- Pesan penutup dari AI: *"Silakan copy prompt di atas dan paste ke textarea Google Stitch Anda. Setelah mendapatkan hasilnya, Anda bisa mengekstrak `DESIGN.md`-nya atau mendownload kode export-nya untuk kita refactor bersama ke dalam repository ini."*
|
|
@@ -192,4 +192,4 @@ Dan **API Endpoints awal**:
|
|
|
192
192
|
- ERD harus mencerminkan user stories di PRD — bukan generic template
|
|
193
193
|
- Setelah generate, tambahkan entry ke `docs/06-DEVELOPMENT-LOG.md`:
|
|
194
194
|
`[KEPUTUSAN] Stack [AppName] dipilih: [ringkasan stack] — Alasan: [ringkasan]`
|
|
195
|
-
-
|
|
195
|
+
- **SKILL CHAINING:** Setelah Tech Design selesai dibuat, JANGAN BERHENTI. Secara proaktif tanyakan kepada user: *"Arsitektur & Tech Stack sudah final! Apakah Anda ingin saya langsung menyusun jadwal Sprint Plan & Backlog menggunakan skill **vibe-buildplan** sekarang?"* Jika user menjawab "Ya", kamu WAJIB langsung mengeksekusi instruksi di `vibe-buildplan`.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Gunakan ini saat memperbaiki bug/error untuk melacak akar masalah dan mitigasi global. Triggers on "/3l5w" atau "/fix-bug".
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# 3L5W Debugging Workflow (Root Cause Analysis & Global Mitigation)
|
|
6
|
+
|
|
7
|
+
Ketika user melaporkan sebuah error atau kamu menemukan bug, JANGAN langsung memperbaiki satu file saja dan berhenti. Terapkan SOP "3 Legs 5 Whys" berikut:
|
|
8
|
+
|
|
9
|
+
## Leg 1: 5 Whys Analysis (Mencari Akar Masalah)
|
|
10
|
+
1. Tuliskan analisa **5 tingkat penyebab** di chat. Tanya "Kenapa ini terjadi?" sampai 5 kali untuk menemukan akar masalah di level sistem/logika terdalam.
|
|
11
|
+
2. Identifikasi dengan pasti apa Root Cause-nya (misal: "Bukan hanya karena variabel *undefined*, tapi karena fetcher tidak mengenkapsulasi error dari origin server").
|
|
12
|
+
3. Perbaiki file atau baris yang secara langsung menyebabkan error tersebut.
|
|
13
|
+
|
|
14
|
+
## Leg 2: Search & Destroy (Menyapu Codebase)
|
|
15
|
+
4. Berdasarkan pola kode (pattern) buruk yang menyebabkan error tadi, GUNAKAN fitur Search (atau grep) untuk memeriksa **seluruh file lain** di repository ini (terutama di direktori yang sama atau komponen serupa).
|
|
16
|
+
5. Cari tahu apakah pengulangan sintaks/pattern buruk yang *persis sama* juga dipakai di titik lain yang belum disentuh/dilaporkan.
|
|
17
|
+
6. Jika direkomendasikan, refactor dan perbaiki SEMUA tempat yang mengandung potensi error tersebut dalam satu tarikan.
|
|
18
|
+
|
|
19
|
+
## Leg 3: Guardrails & Documentation (Mitigasi Masa Depan)
|
|
20
|
+
7. Tambahkan proteksi arsitektural. (Misal: tambah skema Zod validation yang ketat, kembalikan default value fallback, atau bungkus komponen yang rentan dalam Error Boundary/Try-Catch khusus).
|
|
21
|
+
8. **WAJIB:** Catat hasil temuan ini di `docs/troubleshooting.md` dengan format:
|
|
22
|
+
- **[Error]:** Pesan error atau gejala awal
|
|
23
|
+
- **[Akar Masalah (5 Whys)]:** Ringkasan dari analisa Leg 1
|
|
24
|
+
- **[Mitigasi Global]:** Daftar tempat lain yang juga diperbaiki dan *guardrails* yang dipasang agar error serupa Mustahil terulang.
|
|
25
|
+
|
|
26
|
+
*Reminder: Pastikan sebelum mengubah banyak file di Leg 2, kamu meminta persetujuan ("Approve") dari user mengenai list file tambahan yang akan direfactor.*
|
|
@@ -4,8 +4,8 @@ description: Mulai fitur baru dengan benar — buat spec, branch Git, dan siapka
|
|
|
4
4
|
|
|
5
5
|
1. Tanya user: "Nama fitur ini apa? Deskripsi singkat tujuannya?"
|
|
6
6
|
|
|
7
|
-
2. Cek apakah sudah ada spec di folder `specs/` untuk fitur ini.
|
|
8
|
-
Jika belum ada,
|
|
7
|
+
2. **Wajib BDD Spec:** Cek apakah sudah ada spec di folder `specs/` untuk fitur ini.
|
|
8
|
+
Jika belum ada, **PANGGIL SKILL `feature-spec-writer`** sekarang juga untuk membuat spec baru dengan format `NNN-nama-fitur.md`. Pastikan spec mencakup *Acceptance Criteria (Given-When-Then), 4 UI States, dan Data Contract JSON* sebelum lanjut coding!
|
|
9
9
|
|
|
10
10
|
3. Tanya user: "Fitur ini terkait REQ ID berapa dari PRD? (contoh: REQ-020)"
|
|
11
11
|
Tambahkan referensi REQ ID ke spec.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Workflow khusus untuk Audit UI/UX dan Kode Aksesibilitas (WCAG). Panggil saat merapikan komponen Frontend agar terlihat premium.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# UI/UX Audit Workflow
|
|
6
|
+
|
|
7
|
+
Gunakan workflow `/ui-audit` saat Anda selesai membuat sebuah komponen antarmuka pengguna (Frontend Component) dan ingin menyempurnakan estetika, *spacing*, serta aksesibilitasnya.
|
|
8
|
+
|
|
9
|
+
## Langkah-Langkah AI:
|
|
10
|
+
|
|
11
|
+
1. **Ganti Persona:**
|
|
12
|
+
Sebagai AI, Anda **WAJIB** secara otomatis beralih memuat persona `ui-ux-designer` (baca rujukan di `AGENTS_INDEX.md` dan `templates/.agent/agents/ui-ux-designer.md`). Tinggalkan pola pikir *backend* sejenak, dan fokuslah 100% pada *User Experience*.
|
|
13
|
+
|
|
14
|
+
2. **Analisa Komponen Saat Ini:**
|
|
15
|
+
Minta user untuk secara spesifik menyebutkan file mana yang ingin diaudit (atau periksa file yang sedang terbuka di *IDE tab*).
|
|
16
|
+
Lakukan **4 Pengecekan Kritis**:
|
|
17
|
+
- **Spacing & Layout:** Apakah padding/margin cukup lega (breathable)? Apakah menggunakan utility Tailwind yang konsisten (misal p-4, mt-6) dan bukan *magic numbers*?
|
|
18
|
+
- **4 UI States:** Apakah komponen ini punya rupa/tampilan untuk kondisi *Loading*, *Empty*, *Error*, dan *Success*?
|
|
19
|
+
- **Aksesibilitas (a11y):** Apakah ada ARIA labels, alt text, dan role yang sesuai? Apakah keyboard navigation bekerja?
|
|
20
|
+
- **Color Theory & Contrast:** Apakah teks terbaca jelas di atas *background*? Apakah *dark mode* di-_support_ dengan baik?
|
|
21
|
+
|
|
22
|
+
3. **Berikan Laporan Mini:**
|
|
23
|
+
Jangan langsung ubah kodenya. Tuliskan Markdown tabel berisi "*Temuan Isu UI/UX*" dan "*Rekomendasi Estetika*".
|
|
24
|
+
|
|
25
|
+
4. **Tunggu Persetujuan:**
|
|
26
|
+
Tanyakan: *"Apakah Anda ingin saya langsung me-refactor komponen ini sesuai rekomendasi desain di atas?"*
|
|
27
|
+
|
|
28
|
+
5. **Refactor:**
|
|
29
|
+
Jika "Ya", langsung perbaiki kodenya (satu komponen per satu waktu).
|
|
@@ -38,8 +38,9 @@ const token = (await headers()).get('x-callback-token')
|
|
|
38
38
|
- Data sensitif (NIK, rekening) disimpan terenkripsi dengan pgcrypto
|
|
39
39
|
- Firebase: hanya gunakan `firebase_messaging` — JANGAN aktifkan Analytics/Crashlytics
|
|
40
40
|
|
|
41
|
-
## Sebelum coding
|
|
41
|
+
## Sebelum coding (Human-in-the-Loop)
|
|
42
42
|
|
|
43
|
+
- **WAJIB Validasi:** JANGAN langsung menulis file yang panjang secara agresif. Buat *Implementation Plan* singkat di chat, dan MINTA USER mengetik "Lanjut/Approve" sebelum kamu diizinkan mengedit/membuat file.
|
|
43
44
|
- Cek komponen yang ada di `/components/ui/` sebelum buat baru
|
|
44
45
|
- Untuk fitur size M atau L: cek apakah ada spec di `specs/` dulu
|
|
45
46
|
- Satu fokus per sesi — jangan ubah hal di luar scope yang diminta
|
|
@@ -54,11 +55,26 @@ const token = (await headers()).get('x-callback-token')
|
|
|
54
55
|
## Adaptive Memory & Checkbox Task Tracking (Senjata Utama AI)
|
|
55
56
|
|
|
56
57
|
- **Checkbox Workflow**: Setiap kali user memberikan perintah untuk membuat atau memperbaiki fitur, kamu WAJIB memecahkannya menjadi langkah-langkah detail di `docs/task_on_hand.md` dengan format Checkbox (`[ ] Step 1`, `[ ] Step 2`). Kamu harus mengeksekusi instruksi tersebut SATU PER SATU secara berurutan dan mengubah statusnya menjadi `[x]` setiap kodenya selesai! Jangan pernah melompat langkah!
|
|
57
|
-
- **Troubleshooting Log
|
|
58
|
-
|
|
58
|
+
- **Troubleshooting Log & 3L5W Framework**: Jika menemukan ERROR, **JANGAN HANYA** asal *fix* isi 1 file lalu lapor selesai. Terapkan SOP "3 Legs 5 Whys":
|
|
59
|
+
1. **5 Whys Analysis:** Temukan akar masalah terdalamnya.
|
|
60
|
+
2. **Search & Destroy:** Gunakan fitur IDE Search (atau grep_search) untuk memeriksa SELURUH codebase. Caritahu apakah pengulangan sintaks/pattern buruk yang persis sama juga ada di *komponen* atau *file* lain yang belum disentuh.
|
|
61
|
+
3. **Global Mitigation:** Perbaiki file saat ini beserta seluruh temuan relevan lainnya, dan buat proteksi logika (misal: Zod, Null checks) untuk memblokirnya secara struktural.
|
|
62
|
+
4. **Log it:** Beri catatan RCA di `docs/troubleshooting.md`.
|
|
63
|
+
- **Template Code**: Saat disuruh membuat komponen/file baru, SELALU periksa referensi di `templates/.agent/snippets/` dan tiru strukturnya.
|
|
59
64
|
- Di setiap awal sesi, kamu WAJIB membaca `docs/task_on_hand.md` dan `docs/recap.md` (jika ada) untuk *loading context*.
|
|
60
65
|
|
|
61
66
|
## Context7
|
|
62
67
|
|
|
63
68
|
- Saat coding Prisma 7, Next.js 16, Better Auth, BullMQ, Socket.io:
|
|
64
69
|
tambahkan `use context7` di prompt untuk mendapat docs terbaru
|
|
70
|
+
|
|
71
|
+
## 🧠 Skill & Agent Auto-Discovery (WAJIB DIBACA AI)
|
|
72
|
+
|
|
73
|
+
Project ini memiliki PULUHAN skill di `.agent/skills/` dan PULUHAN agent persona di `.agent/agents/`. User **TIDAK PERLU** menghafal atau mengetikkan namanya secara manual!
|
|
74
|
+
|
|
75
|
+
Sebagai AI cerdas pengelola repository, setiap kali user memberikan perintah (misal: "buat fitur auth", "setup routing", "buat koneksi Xendit", "evaluasi security"):
|
|
76
|
+
1. **Identifikasi Persona (Agent):** Buka dan baca rujukan `templates/.agent/AGENTS_INDEX.md`. Pilih 1 persona yang paling relevan (misal: `backend-specialist` atau `security-auditor`), lalu resapi instruksi roh/persona tersebut dengan membaca `templates/.agent/agents/[NAMA_AGENT].md`.
|
|
77
|
+
2. **Identifikasi Skill Teknis:** Buka dan baca rujukan `templates/.agent/SKILLS_INDEX.md`. Temukan satu atau beberapa skill teknis yang cocok (misal: `xendit-integration`, `nextjs-api-route`).
|
|
78
|
+
3. **Load Context & Execute:** Baca aturan lengkap skill tersebut di `templates/.agent/skills/[NAMA_SKILL]/SKILL.md` **SEBELUM** memulai eksekusi.
|
|
79
|
+
|
|
80
|
+
Lakukan ketiga tahapan *Auto-Discovery* ini secara proaktif di belakang layar. Ini menjamin kode Anda selalu diproduksi dengan *mindset* ahli (Expert) yang tepat dan mematuhi SOP kualitas tertinggi tanpa perlu di- *micro-manage* oleh user!
|