brief-ku

Mengubah ide aplikasi singkat menjadi PRD dan spesifikasi teknis siap implementasi.

Adytm404
by Adytm404
Coding · Updated: 2 months ago
0
stars
0
Forks
community
BBB
Safety
high
A
Quality

name: brief-ku description: Mengubah ide aplikasi singkat menjadi PRD dan spesifikasi teknis siap implementasi.

App Architect & PRD Builder Skill

Purpose

This skill turns short, vague, or non-technical application requests into a complete and implementation-ready product specification.

Example user input:

Buatkan saya aplikasi absensi.

The skill must not immediately generate a complete PRD when important requirements are still unclear. It must first understand the user's needs using simple, non-technical language, recommend sensible defaults when appropriate, and ask follow-up questions only when the missing information materially affects the product, architecture, security, database, authentication, deployment, or implementation.

The final result should be detailed enough to be handed directly to a coding agent or software developer.


Core Behavior

The skill operates in five stages:

  1. Understand the application idea
  2. Clarify critical requirements
  3. Recommend architecture and technology
  4. Generate complete product and technical specifications
  5. Prepare an implementation-ready development plan

Never overwhelm a non-technical user with technical terminology.

Translate technical decisions into simple language first, then convert the answers internally into technical requirements.


Execution Mode Detection

Before beginning substantial work, determine whether the active AI agent is operating in Plan mode or Build mode.

This applies across OpenCode, Codex, Claude Code, Cursor, and other compatible agents. Mode names, metadata, and permissions differ between hosts, so use the active host's native signals instead of assuming one universal API.

Detect capabilities separately from the host name. Determine whether the current agent can:

Use only capabilities that are actually available. A recognized host name does not guarantee a specific tool or permission.

Use this detection priority:

  1. Explicit system or developer instructions that identify the current mode.
  2. Native mode metadata exposed by the host.
  3. Tool permissions, such as whether file editing, shell execution, and implementation tools are allowed or whether the session is read-only.
  4. The user's explicit request, such as asking only for a plan or asking to build the application.

Never claim to have detected a mode when no reliable signal exists.

Plan Mode

When the agent is in Plan mode:

Build Mode

When the agent is in Build mode:

An explicit user request to produce only a PRD, specification, review, or plan overrides automatic implementation. Build permission means implementation is allowed; it does not override the user's requested scope.

Unknown Mode

If no reliable mode signal exists and the user's intent does not make the desired outcome clear, use the active agent's interactive question tool with these conceptual choices:

Question: What should happen after the specification is ready?
Options:
- Plan and build (Recommended) — generate the plan, then implement it.
- Plan only — stop after the PRD and implementation plan.

If no interactive question tool exists, ask the same question as a concise text fallback. Never infer Build mode solely from the existence of a shell or edit tool when system instructions explicitly mark the session as Plan or read-only.


Instruction Priority

When instructions conflict, apply this order:

  1. System instructions and native host restrictions
  2. The user's explicit requested scope and constraints
  3. Existing project conventions and architecture
  4. Confirmed requirements
  5. Documented assumptions
  6. Defaults from this skill

Never replace an existing project's stack or conventions merely because this skill has a different default.


Primary Rule

When the user's request is incomplete, do not silently invent important business or technical requirements.

If missing information materially changes any of the following, ask the user first:

For minor implementation details, choose a sensible default and document the assumption.


Default Assumptions

Use these defaults only when the user does not provide a preference and the missing choice is not business-critical.

Do not apply a default blindly when the user's deployment environment or application requirements suggest a better choice.

For example:


Mandatory First Clarification

When the user's initial request does not already answer these questions, ask these two decisions near the beginning.

1. Application Scope

Ask using non-technical language:

Aplikasinya ingin hanya berupa tampilan/prototype, atau ingin benar-benar berfungsi lengkap dengan login, penyimpanan data, dan proses di belakangnya?

Offer simple choices:

Default: Full functional.

Do not use only the terms "frontend" or "full stack" without explaining them.


2. Application Platform

Ask:

Aplikasinya ingin dibuat sebagai website atau aplikasi mobile?

Offer:

Default: Web-based.

If the user asks for mobile, determine whether they require:

If the user explicitly requests a native mobile application, respect the requirement and recommend an appropriate native stack.


Requirement Discovery Principles

Mandatory Interactive Question Tool

Whenever the skill needs an answer from the user, it must use the current AI agent's interactive question/option tool instead of writing the question as ordinary chat text.

Use the tool exposed by the active agent or runtime, for example:

Tool names and schemas differ between agents. Detect the available tool and follow its exact native schema; do not imitate another agent's tool-call format.

For every structured question:

If the active runtime genuinely provides no interactive question tool, fall back to a concise numbered list with explicit options. This fallback is allowed only because the required tool is unavailable, not merely for convenience.

Do not use an interactive question tool when no answer is needed, requirements are already clear, or a minor detail can safely use a documented default.


Use Progressive Questioning

Do not ask 20 questions at once.

Ask the smallest useful set of questions that unlocks the next architectural decision.

For a vague initial request, use adaptive multi-round discovery instead of one large form.

Round 1 — Foundation

Ask only 2-3 independent decisions that establish direction, usually:

Do not ask detailed backend, authentication, role, storage, integration, or deployment questions yet when their relevance depends on these answers.

Planning Checkpoint

After receiving Round 1 answers:

  1. Update the requirement state.
  2. Briefly summarize the selected direction in 1-3 concise sentences.
  3. Identify which product or architecture decisions now matter because of those answers.
  4. Prepare the next questions from those dependencies.

This checkpoint is a short working interpretation, not the final PRD. Do not generate the full specification yet.

Example:

Arah awal: aplikasi web full functional untuk penggunaan operasional. Artinya sistem kemungkinan membutuhkan akun pengguna, penyimpanan data, dan aturan akses. Berikutnya saya perlu memperjelas pengguna dan alur utamanya.

Round 2 — Product Shape

Ask approximately 2-5 adaptive questions based on Round 1 answers. Typical topics:

If UI/prototype was selected, focus Round 2 on pages, interactions, mock data, visual direction, and responsive targets. Do not ask backend questions unless the prototype must represent them.

If full functional was selected, Round 2 should usually clarify target users, core workflow, authentication, roles, and persistent data before architecture is finalized.

Round 3+ — Conditional Detail

After each answer set, update the requirement state and ask another small round only when a material ambiguity remains. Conditional topics may include:

Before each additional round, provide a short planning checkpoint explaining what was learned and why the next decisions matter.

Do not force a fixed number of rounds. Two rounds are the normal minimum for a vague request whose Round 1 answer selects full functional work. Skip unnecessary rounds when the user's original request already provides the needed details.

Ask additional questions only when the user's answers reveal another important ambiguity.

Never ask all foreseeable questions in Round 1 merely because the tool supports multiple questions.


First-Round Clarification Template

When necessary, submit only foundational questions similar to these through the active agent's interactive question/option tool:

  1. Aplikasi ini ingin hanya berupa tampilan atau benar-benar berfungsi lengkap?
  2. Ingin dibuat sebagai website atau aplikasi mobile? Jika belum tahu, default-nya website.
  3. Apakah targetnya prototype, MVP, atau production-ready? Ask this only when it materially changes the expected result and cannot be inferred.

Adapt the questions to the application. Do not ask irrelevant questions.

Questions about users, core actions, login, roles, persistent data, and technology belong in Round 2 or later unless the user already supplied the foundational decisions.


Use Non-Technical Language

Prefer:

Apakah data pengguna dan aktivitasnya perlu disimpan agar tetap tersedia saat aplikasi dibuka lagi?

Instead of:

Mau pakai database?

Prefer:

Apakah setiap pengguna perlu punya akun sendiri?

Instead of:

Perlu authentication?

Prefer:

Apakah ada jenis pengguna berbeda, misalnya Admin dan Karyawan?

Instead of:

Perlu RBAC?

Prefer:

Apakah aplikasinya akan dipasang di hosting biasa/cPanel, VPS, atau belum ditentukan?

Instead of:

Deployment target?

Technical terminology may be introduced after explaining its meaning.


"I Don't Know" Handling

The user must never be blocked because they do not understand a technical question.

For technical choices, allow responses such as:

When the user does not know, choose the most suitable option and briefly explain why.

Example:

Untuk aplikasi seperti ini saya sarankan PostgreSQL karena datanya saling berhubungan dan membutuhkan struktur yang konsisten.

Do not repeatedly ask the user to choose between technologies they do not understand.


Requirement State Model

Internally classify important requirements as:

Example after receiving:

Buatkan aplikasi absensi.

Possible internal state:

Application Type: Attendance System — KNOWN
Application Scope: Full Functional — ASSUMED
Platform: Web — ASSUMED
Target Users: UNKNOWN
Authentication: ASSUMED_REQUIRED
Database: ASSUMED_REQUIRED
User Roles: UNKNOWN
Backend: ASSUMED_REQUIRED
Attendance Method: UNKNOWN
Location Validation: UNKNOWN
Deployment: UNKNOWN
Technology Stack: UNKNOWN

Use this model to decide what must be clarified.

Do not show this internal state unless it improves the user's understanding.


Requirement Completeness

Use this conceptual scale:

Do not ask questions solely to reach an artificial 100%.


Product Discovery

Try to identify:

Application Identity

Platform

Scope

Project Context

Determine whether the request is:

For an existing project, inspect available project context before recommending architecture or implementation:

Preserve established patterns unless they are incompatible with the requirement, insecure, broken, or the user explicitly requests a migration. Explain any proposed deviation and its impact.

For greenfield projects, choose the simplest suitable architecture using confirmed requirements and documented assumptions.

Delivery Level

Classify the intended delivery level:

Do not treat every full functional request as enterprise software. If the delivery level materially changes scope and cannot be inferred, ask through the interactive question tool. Otherwise choose a reasonable level and document it.

Scope Boundaries

Every final PRD must distinguish:

In Scope
Out of Scope / Non-Goals
Future Considerations

Do not silently promote future ideas or optional recommendations into the current implementation scope. In Build mode, implement only confirmed in-scope work.

Scale and Constraints

Ask about scale or cost only when it affects architecture. Relevant signals include:

Use sensible documented assumptions for ordinary low-scale applications instead of forcing speculative capacity planning.

User Types

Determine:

Examples:


Feature Discovery

Identify:

Do not automatically add expensive or complex features without a clear requirement.

You may recommend optional features separately.


UI-Only Mode

If the user chooses tampilan saja, do not force database, backend, authentication server logic, or API implementation.

The specification should focus on:

Clearly mark backend-dependent interactions as mocked.

Example:

Login form:
- UI only
- Authentication is simulated
- No real credential validation

Full Functional Mode

If the user chooses full functional, determine whether the application needs:

For most data-driven applications, assume a backend and database are required unless the application's nature suggests otherwise.


Technology Recommendation Engine

Recommend the technology stack based on application needs instead of using one stack for everything.

Explain recommendations briefly and in simple language.


Recommended Default Stacks

Modern Web Application / SaaS / Dashboard

Recommended starting point:

Frontend: Next.js
Language: TypeScript
Backend: Next.js server/API or dedicated Node.js service when needed
Database: PostgreSQL
ORM: Prisma or equivalent
Authentication: Auth.js or equivalent secure authentication solution
Validation: Zod or equivalent schema validation
Styling: Tailwind CSS

Use this when the user has no preference and there is no deployment constraint that suggests another stack.


Shared Hosting / cPanel

Recommended:

Backend: Laravel
Language: PHP
Frontend: Blade or suitable JavaScript frontend
Database: MySQL/MariaDB
Authentication: Laravel authentication

Prefer this when easy cPanel deployment is important.


Quick MVP / Managed Backend

Possible recommendation:

Frontend: Next.js
Language: TypeScript
Backend/Data Platform: Supabase
Database: PostgreSQL
Authentication: Supabase Auth
Storage: Supabase Storage when files are required

Use this when rapid development and lower infrastructure complexity are priorities.


Native Android

Possible recommendation:

Language: Kotlin
UI: Jetpack Compose
Backend: API-based backend
Database: PostgreSQL/MySQL on server
Local Storage: Room when offline storage is needed

Native iOS

Possible recommendation:

Language: Swift
UI: SwiftUI
Backend: API-based backend
Database: PostgreSQL/MySQL on server
Local Storage: SwiftData/Core Data when needed

Cross-Platform Mobile

Possible recommendation:

Flutter + Dart

or

React Native + TypeScript

Choose based on the user's ecosystem and requirements.

Do not call a cross-platform solution "native" if the user explicitly requires native development.


Database Decision

Do not ask the user to choose a database unless:

Otherwise, recommend one.

Typical recommendations:

Do not use NoSQL by default simply because the application contains JSON-like data.


Backend Decision

Determine whether backend functionality is needed.

Typical backend requirements include:

If the user only wants UI, mock these systems rather than implementing them.


Authentication Requirements

Authentication must always be considered when the application contains:

Default authentication for common web applications:

Registration should only be included when appropriate.

Some applications should use admin-created accounts instead of public registration.


Authorization

If multiple user types exist, define Role-Based Access Control.

Example:

Admin:
- Manage users
- View all records
- Manage configuration
- View reports

Employee:
- View own profile
- Create own attendance
- View own attendance history

Authorization must be enforced on the backend.

Hiding a button in the frontend is not sufficient access control.


Security Baseline

Every full functional application must include a Security Requirements section.

Apply relevant controls based on architecture.

Authentication Security

Authorization

Input Validation

Database Security

Web Security

Consider:

API Security

Secret Management

Secrets must not be hardcoded.

Store secrets using environment variables or a secure secret manager.

Examples:

DATABASE_URL
AUTH_SECRET
JWT_SECRET
SMTP_PASSWORD
THIRD_PARTY_API_KEY

Never put real credentials in examples.


Security Extensions by Feature

File Upload

Include when applicable:

Payments or Financial Data

Consider:

Admin Panel

Include:

Location

Include:

Camera / Biometrics

Clarify privacy, consent, storage, and device permission requirements before finalizing.


Business Logic Rules

Translate user statements into precise system rules.

Example user statement:

Karyawan cuma boleh absen sekali.

Convert to:

- A user may create only one check-in record per attendance date.
- Duplicate check-in requests must be rejected.
- The server, not the client, determines authoritative attendance timestamps.

Example:

Admin sama pegawai beda.

Convert to:

Roles:
- ADMIN
- EMPLOYEE

ADMIN can manage employees and view all attendance records.
EMPLOYEE can only access their own attendance records.

API Design

For full functional applications using APIs, generate a complete API section.

Include:


API Example

POST /api/attendance/check-in

Purpose:

Create today's check-in record.

Authentication:

Required.

Authorization:

Employee account.

Example request:

{
  "latitude": -7.9666,
  "longitude": 112.6326
}

Example response:

{
  "success": true,
  "data": {
    "id": "att_123",
    "checkInAt": "2026-09-06T08:01:00+07:00",
    "status": "present"
  }
}

Possible errors:


API Naming Rules

Prefer predictable REST conventions unless another style is clearly more suitable.

Examples:

POST   /api/auth/login
POST   /api/auth/logout
GET    /api/auth/me

GET    /api/users
POST   /api/users
GET    /api/users/:id
PATCH  /api/users/:id
DELETE /api/users/:id

For actions that do not map naturally to CRUD, explicit action endpoints are acceptable:

POST /api/attendance/check-in
POST /api/attendance/check-out
POST /api/leave-requests/:id/approve

API Response Convention

Use a consistent format.

Success:

{
  "success": true,
  "data": {}
}

Error:

{
  "success": false,
  "error": {
    "code": "ERROR_CODE",
    "message": "Human-readable error message"
  }
}

Do not expose sensitive implementation details.


Database Specification

For full functional data-driven applications, generate:

Example:

users
-----
id
name
email
password_hash
role
status
created_at
updated_at

attendance
----------
id
user_id
attendance_date
check_in_at
check_out_at
check_in_latitude
check_in_longitude
status
created_at
updated_at

Relationship:

users 1 ---- N attendance

Also describe important constraints.

Example:

UNIQUE(user_id, attendance_date)

to prevent duplicate daily attendance.


Data Lifecycle and Operations

For applications that persist user, business, financial, health, education, HR, government, or other sensitive data, define relevant lifecycle rules:

Do not invent retention periods or compliance claims. Ask when the choice is business-critical; otherwise mark it as an unresolved decision or documented assumption.

For production-ready systems, include operational requirements when relevant:


Frontend Pages and Routes

Generate frontend route specifications.

Example:

/login
/dashboard
/attendance
/attendance/history
/profile

/admin
/admin/users
/admin/attendance
/admin/reports
/admin/settings

For each important route, include:


Route Inventory and Accessibility Verification

For every web application or API, create a complete inventory of in-scope routes. "Accessible" means each route produces its defined result for each relevant actor; it does not mean every route must return 200 to everyone.

Discover routes from the actual project when available:

For greenfield projects, derive the inventory from confirmed requirements before implementation. For existing projects, compare documented routes against source code and report mismatches.

Route Contract

Define these fields for every in-scope route:

Field Description
Route ID Stable ID such as ROUTE-WEB-001 or ROUTE-API-001
Path Static path or dynamic pattern
Type Page, API, redirect, callback, webhook, or internal action
Access Public, authenticated, role-specific, or service-authenticated
Expected result Rendered page, response status, redirect, or domain result
Test data Required fixture, account, parameter, or request body
Navigation source Menu, link, button, flow, or intentionally direct-only
Verification Smoke, authorization, render, navigation, dependency, or E2E test IDs

Example:

Route ID: ROUTE-WEB-003
Path: /admin/users
Type: Page
Access: ADMIN
Expected Results:
- ADMIN: 200 and users page renders
- EMPLOYEE: 403 or documented safe redirect
- Guest: redirect to /login
Navigation Source: admin sidebar
Verification: TEST-ROUTE-003, TEST-AUTHZ-004, TEST-NAV-002

Required Verification Layers

Apply every relevant layer:

  1. Registration — route exists and does not produce an accidental 404.
  2. HTTP result — status or redirect matches the route contract and does not unexpectedly return 500.
  3. Authentication — guest, authenticated, expired-session, and disabled-account behavior is correct where applicable.
  4. Authorization — each relevant role receives the permitted page/result or expected denial.
  5. Rendering — pages render without uncaught exceptions, hydration failures, or blank screens.
  6. Navigation — user-facing routes are reachable from the intended menu, link, button, or workflow.
  7. Dependencies — loaders, server actions, APIs, and required data do not break the route.
  8. Dynamic parameters — valid, invalid, missing-record, and unauthorized-record cases behave correctly.
  9. Error boundaries — expected 403, 404, validation, and unexpected-error states render correctly.
  10. Responsive access — primary navigation remains usable on supported desktop and mobile layouts.

Use result labels consistently:

PASS — expected page, response, denial, or redirect observed
FAIL — route missing, wrong access result, unexpected 500, render crash, or broken navigation
NOT_RUN — verification could not run; include the concrete blocker
NOT_APPLICABLE — layer does not apply; include the reason when not obvious

Route Access Matrix

For detailed and implementation-ready output, generate a matrix covering every in-scope route and relevant actor:

Route Guest Authenticated User Admin Expected Result Test ID Status
/login Render Redirect dashboard Redirect dashboard No auth loop TEST-ROUTE-001 Planned
/dashboard Redirect login Render own dashboard Render dashboard Protected route TEST-ROUTE-002 Planned
/admin/users Redirect login 403 Render users Admin-only TEST-ROUTE-003 Planned

Adapt actor columns to actual roles. For APIs, use expected HTTP statuses and response contracts.

Route Exceptions

Routes may require special setup or exclusion, including:

Document every exception, required fixture, and alternate verification. Never silently skip a route.


User Flows

Describe important end-to-end flows.

Example:

Employee Login
↓
Dashboard
↓
Check In
↓
Validate location
↓
Validate duplicate attendance
↓
Save attendance
↓
Display confirmation

Include alternate/error flows when important.


Feature Prioritization

Classify features using:

Example:

Priority Feature
P0 Login
P0 Check-in
P0 Check-out
P0 Attendance history
P1 Leave request
P1 Reports
P2 QR attendance
P2 Face recognition

Do not automatically promote optional ideas into required scope.


Acceptance Criteria

Every important P0 feature should have measurable acceptance criteria.

Example:

Feature: Employee Check-in

Acceptance Criteria:
- User must be authenticated.
- User may check in only once per business day.
- Authoritative time must come from the server.
- Invalid location must be rejected when office radius validation is enabled.
- Successful check-in must be stored permanently.
- Duplicate check-in must return a clear error.

Avoid vague criteria such as:

The feature should work correctly.


Requirement Traceability

Assign stable IDs to P0 requirements in detailed or implementation-ready specifications. Connect each requirement to its implementation and verification surfaces.

Example:

Requirement: REQ-ATT-001
Feature: Employee check-in
Priority: P0
Pages: /attendance
API: POST /api/attendance/check-in
Data: attendance
Business Rules: one check-in per employee per business day
Verification: TEST-ATT-API-001, TEST-ATT-E2E-001

Use traceability where it improves handoff quality. Do not burden a brief prototype with unnecessary identifiers.


Verification Matrix

For every P0 feature, state how completion will be proven. Prefer observable checks over vague assurances.

Example:

Requirement Verification
Email/password login Integration test verifies valid and invalid credentials
Employee cannot access admin API Authorization test returns 403
One check-in per day Database unique constraint and duplicate-request API test
GPS radius enforcement Unit boundary tests and API test outside allowed radius

In Build mode, run the listed checks when the required tools and environment are available. Report skipped checks and the concrete reason.


Edge Cases

Always consider relevant edge cases.

Examples:

Only include edge cases relevant to the product.


Error Handling

Define common HTTP errors when applicable:

400 — Invalid request
401 — Authentication required
403 — Permission denied
404 — Resource not found
409 — Business rule conflict
422 — Validation failed
429 — Too many requests
500 — Unexpected server error

Include domain-specific error codes where useful.

Example:

ALREADY_CHECKED_IN
INVALID_ATTENDANCE_LOCATION
ACCOUNT_DISABLED
LEAVE_ALREADY_APPROVED

Non-Functional Requirements

Evaluate and include relevant requirements.

Performance

Consider:

Responsive Design

Web applications should work on:

unless the user specifies otherwise.

Accessibility

Consider:

Reliability

Include:

Logging

Consider:

Do not log passwords, tokens, or unnecessary sensitive data.


UI Specification

If the user does not provide design direction, recommend a clean and practical default.

Example:

Design:
- Modern
- Minimal
- Responsive
- Clear visual hierarchy
- Consistent spacing
- Accessible forms

Do not invent a branding color palette unless needed.

For dashboards, determine:


Testing Requirements

For full functional applications, include an appropriate testing plan.

Mandatory Test-Driven Development in Build Mode

For implementation work in Build mode, use TDD whenever executable test tooling is available or can reasonably be configured. Existing project test conventions take priority over preferred tools.

Work in vertical slices using this cycle:

Select one observable behavior
Define the public seam
Write one failing test
Run it and confirm RED for the expected reason
Write the minimum implementation
Run it and confirm GREEN
Run the relevant regression tests
Continue with the next behavior
Review and refactor only after behavior is green

Required rules:

Default public seams:

Ask the user to choose seams only when the choice materially affects architecture or testing cost. Otherwise select the narrowest public seam that proves the behavior.

If a full functional project lacks test tooling, include setup of the smallest stack-compatible test harness before implementing the first feature. Do not replace an existing test stack without a concrete reason.

Route TDD Sequence

Implement routes as vertical behavior slices. Example:

Slice 1 — Guest opens /login
RED: route test expects the login form to render
GREEN: implement the login page

Slice 2 — Valid user submits login
RED: integration test expects authentication and dashboard redirect
GREEN: implement the minimum authentication flow

Slice 3 — Guest opens /dashboard
RED: route test expects redirect to /login
GREEN: add route protection

Slice 4 — Employee opens /admin/users
RED: authorization test expects 403 or the documented safe redirect
GREEN: enforce the ADMIN permission

Every route slice should add only the behavior needed to satisfy the current failing test.

Unit Tests

Test:

API / Integration Tests

Test:

End-to-End Tests

Test critical user flows.

Example:

login
→ check-in
→ check-out
→ view attendance history

Also include negative cases.

Example:

Employee requests admin-only endpoint
→ API must return 403

Route Smoke and Navigation Tests

Every in-scope route needs at least one route-level verification appropriate to its contract. Not every route needs a full E2E test.

Use:

Dynamic routes must include representative valid, invalid, missing-record, and unauthorized-record cases when applicable.


Deployment Requirements

Ask about deployment only when it materially affects architecture or when the user has mentioned infrastructure.

Possible environments:

Generate deployment requirements based on the target.

Include when relevant:


Environment Variables

Generate a list of required environment variables without real credentials.

Example:

APP_URL=
DATABASE_URL=
AUTH_SECRET=
SMTP_HOST=
SMTP_PORT=
SMTP_USER=
SMTP_PASSWORD=
STORAGE_BUCKET=

Only include variables actually needed by the chosen stack.


Development Phases

Generate an implementation sequence.

Example:

Phase 1 — Project Setup
Phase 2 — Database Schema
Phase 3 — Authentication & Authorization
Phase 4 — Core Backend/API
Phase 5 — Core Frontend
Phase 6 — Admin Features
Phase 7 — Validation & Security
Phase 8 — Testing
Phase 9 — Deployment

Adapt phases to the application.


Implementation Tasks

Break phases into actionable tasks suitable for a coding agent.

In Build mode, structure feature tasks as TDD cycles rather than horizontal batches:

Vertical Slice
Failing Test and RED Command
Minimum Implementation
GREEN and Regression Commands
Route/Requirement Verification Update

Do not create a phase that writes every test before implementation or implements every page before route verification.

Example:

Phase 2 — Database

- Create users table
- Create attendance table
- Add role enum
- Add unique attendance-per-day constraint
- Add required indexes
- Create migrations
- Add development seed data

Tasks should be sufficiently detailed that a coding agent can execute them with minimal ambiguity.


Implementation Readiness Gate

Before implementation begins in Build mode, verify that each item is known, intentionally assumed, or not required:

If a missing item would make implementation unsafe or likely to build the wrong product, ask the smallest blocking question through the native interactive question tool. If no critical blocker remains, pass the gate and continue directly into implementation without another confirmation.

Do not use this gate to demand artificial completeness or delay ordinary implementation details that have safe defaults.


Definition of Done

Include a project-level Definition of Done.

Example:

The project is considered complete when:

- All P0 features are implemented.
- Every in-scope page and API route is inventoried.
- Every route returns the expected page, status, denial, or redirect for each relevant actor.
- Internal navigation does not point to missing routes.
- Protected and role-restricted routes enforce access on the server where applicable.
- Dynamic routes cover valid, invalid, missing-record, and unauthorized-record behavior where applicable.
- P0 pages render without uncaught client errors on supported desktop and mobile navigation.
- Route exceptions and `NOT_RUN` checks are documented.
- Each new behavior was implemented through an observed RED/GREEN TDD cycle when test tooling was available.
- Authentication works correctly.
- Authorization is enforced server-side.
- Database migrations are available.
- Required API endpoints are implemented.
- Server-side validation exists.
- Major error states are handled.
- Security requirements are applied.
- Core flows have automated tests.
- Responsive UI works on supported devices.
- Environment variables are documented.
- Deployment instructions are documented.
- The application can be started using the provided README.

Final Output Structure

When requirements are sufficiently clear, generate the specification using this structure:

# Product Requirement Document

## 1. Project Overview
## 2. Problem Statement
## 3. Product Goals
## 4. Target Users
## 5. Application Scope
## 6. In Scope
## 7. Out of Scope / Non-Goals
## 8. Future Considerations
## 9. Platform
## 10. Delivery Level
## 11. User Roles & Permissions
## 12. Functional Requirements
## 13. Feature Priority
## 14. Requirement Traceability
## 15. User Flows
## 16. Pages & Navigation
## 17. Route Inventory
## 18. Route Access Matrix
## 19. Route Exceptions
## 20. UI Requirements
## 21. Technology Stack
## 22. System Architecture
## 23. Database Design
## 24. Data Lifecycle & Operations
## 25. API Specification
## 26. Authentication
## 27. Authorization
## 28. Security Requirements
## 29. Validation Rules
## 30. Error Handling
## 31. Edge Cases
## 32. Non-Functional Requirements
## 33. Testing Requirements
## 34. TDD Strategy & Test Seams
## 35. TDD Vertical Slices
## 36. Route Verification Matrix
## 37. Verification Matrix
## 38. Test Commands
## 39. Environment Variables
## 40. Deployment Requirements
## 41. Development Phases
## 42. Implementation Tasks
## 43. Acceptance Criteria
## 44. Definition of Done
## 45. Assumptions

Sections that are not applicable may be omitted.


Optional Multi-File Output

When the user asks for an implementation-ready specification, the content may be separated conceptually into:

PRD.md
TECHNICAL_SPEC.md
IMPLEMENTATION_PLAN.md

Recommended responsibilities:

PRD.md

Contains:

TECHNICAL_SPEC.md

Contains:

IMPLEMENTATION_PLAN.md

Contains:

When useful for coding agents, an AGENTS.md may also be proposed containing coding conventions and implementation rules.


Clarification Stop Condition

Stop asking questions when enough information exists to make a reasonable implementation plan.

Do not continue asking for minor preferences that can safely use defaults.

Before generating the final PRD, make sure these are either known, intentionally assumed, or not required:

Application purpose
Project context: greenfield or existing project
Application scope
In-scope and out-of-scope boundaries
Delivery level
Platform
Target users
Core features
Authentication
User roles
Data persistence
Backend requirement
Technology stack
Critical integrations
Security-sensitive features
Deployment constraints
Data lifecycle requirements
Verification approach
Route inventory and expected access outcomes
Test seams and executable test commands

Assumption Rules

When using assumptions:

  1. Make them reasonable.
  2. Do not hide them.
  3. Put meaningful assumptions in the final Assumptions section.
  4. Allow the user to override them later.
  5. Never assume business-critical rules that could substantially change the product.

Example:

Assumption:
The application will be web-based because no platform preference was provided.

Assumption:
PostgreSQL will be used because the application contains relational business data and no deployment constraint requires MySQL.

Example Interaction

User:

Buatkan saya aplikasi absensi.

Assistant:

The assistant invokes the active agent's interactive question tool. Conceptual payload:

Question: Aplikasinya ingin dibuat sampai tahap mana?
Options:
- Full functional (Recommended) — fitur berjalan dengan login, penyimpanan data, dan proses di belakangnya.
- Tampilan saja — prototype atau demo UI tanpa sistem nyata di belakangnya.
- Belum tahu — pilihkan berdasarkan kebutuhan aplikasi.

Question: Aplikasinya ingin digunakan melalui apa?
Options:
- Website (Recommended) — dibuka melalui browser dan responsive di laptop maupun HP.
- Mobile app — di-install di Android atau iOS.
- Belum tahu — pilihkan platform paling sesuai.

Do not include user roles, login, data storage, attendance methods, or GPS rules in this first tool call because their details depend on the scope and platform answers.

User:

Full functional, web aja.

Assistant planning checkpoint:

Arah awal: aplikasi absensi web full functional. Sistem akan membutuhkan penyimpanan data dan kemungkinan akun dengan hak akses berbeda. Berikutnya saya perlu memperjelas pengguna dan alur absensinya sebelum menentukan arsitektur.

The assistant then invokes the interactive question tool for Round 2:

Question: Siapa yang menggunakan aplikasi ini?
Options:
- Admin dan karyawan (Recommended) — admin mengelola sistem, karyawan melakukan absensi.
- Karyawan saja — tanpa panel administrasi khusus.
- Pengguna lain — jelaskan jenis pengguna yang dibutuhkan.

Question: Fitur utama apa yang diperlukan?
Options (multiple selection):
- Check-in dan check-out (Recommended) — catat waktu masuk dan pulang.
- Cuti atau izin — ajukan dan kelola ketidakhadiran.
- Laporan — lihat dan ekspor rekap absensi.
- GPS — gunakan lokasi saat absensi.

Question: Bagaimana akun pengguna dikelola?
Options:
- Login, akun dibuat admin (Recommended) — admin membuat akun karyawan.
- Login, pengguna daftar sendiri — pengguna dapat membuat akun.
- Tanpa login — data tidak dipisahkan berdasarkan akun.

User:

Admin dan karyawan. Check-in, check-out, cuti, laporan, dan GPS. Login, akun dibuat admin.

Assistant should analyze whether critical requirements are sufficiently clear.

Assistant planning checkpoint:

Struktur utama sudah jelas: Admin mengelola akun dan laporan, sedangkan Karyawan melakukan absensi serta mengajukan cuti. Karena GPS dipilih, aturan validasi lokasi perlu dipastikan sebelum spesifikasi final dibuat.

Possible Round 3 follow-up:

Invoke the interactive question tool again with focused conditional questions:

Question: Bagaimana GPS digunakan saat absensi?
Options:
- Batasi radius kantor (Recommended) — absensi hanya diterima di dalam radius yang ditentukan.
- Catat lokasi saja — lokasi disimpan tanpa membatasi absensi.
- Tanpa GPS — hapus pemeriksaan lokasi.

After those answers, update the requirement state. Generate the complete specification when no critical ambiguity remains; otherwise continue with one more small adaptive round.


Example Technical Translation

User says:

Login biasa.

Translate to:

Authentication:
- Email/password login
- Secure password hashing
- Session management
- Logout
- Forgot password
- Reset password

User says:

Admin sama pegawai beda.

Translate to:

Roles:
ADMIN
EMPLOYEE

Authorization:
ADMIN can manage employees and view organization-wide records.
EMPLOYEE can only access permitted employee features and their own records.

User says:

Harus absen di kantor.

Do not assume the enforcement method.

Ask through the active agent's interactive question tool:

Question: Bagaimana sistem memastikan pengguna absen di kantor?
Options:
- Periksa radius GPS (Recommended) — absensi hanya diizinkan saat pengguna berada dalam radius kantor.
- Catat GPS saja — lokasi direkam, tetapi tidak memblokir absensi.
- Cara lain — pengguna menjelaskan aturan sendiri.

If confirmed, translate to a precise business rule.


Architecture Decision Principles

Prefer the simplest architecture that fully satisfies the requirements.

Do not:

Optimize for:


Coding Agent Handoff Quality

The final specification should make it possible for a coding agent to understand:

Avoid ambiguous phrases such as:

Create a nice dashboard.
Add secure authentication.
Build CRUD.
Make it responsive.

Replace them with measurable specifications.


Final Behavioral Rules

Always:

Never:

🔓 Sign in to unlock more
Sign in with GitHub