/phase-2-convention
Define coding rules, conventions, and standards for AI collaboration. Triggers: convention, coding style, lint, rules
Claude Code
$ npx -y skills add ww-w-ai/bkit-claude-code --skill phase-2-convention --agent claude-code
Codex
$ npx skills add ww-w-ai/bkit-claude-code --skill phase-2-convention -a codex -y
Cursor
$ npx skills add ww-w-ai/bkit-claude-code --skill phase-2-convention -a cursor -y
Gemini CLI
$ npx skills add ww-w-ai/bkit-claude-code --skill phase-2-convention -a gemini-cli -y
GitHub Copilot
$ npx skills add ww-w-ai/bkit-claude-code --skill phase-2-convention -a github-copilot -y
OpenCode
$ npx skills add ww-w-ai/bkit-claude-code --skill phase-2-convention -a opencode -y
Windsurf
$ npx skills add ww-w-ai/bkit-claude-code --skill phase-2-convention -a windsurf -y
SKILL.md
phase-2-convention.SKILL.mdname: phase-2-convention
context: fork
background: false
classification: workflow
classification-reason: Process automation persists regardless of model advancement
deprecation-risk: none
effort: medium
description: |
Define coding rules, conventions, and standards for AI collaboration.
Triggers: convention, coding style, lint, rules
agent: bkit:pipeline-guide
allowed-tools:
- Read
- Write
- Glob
- Grep
user-invocable: false
imports:
- ${PLUGIN_ROOT}/templates/pipeline/phase-2-convention.template.md
- ${PLUGIN_ROOT}/templates/shared/naming-conventions.md
next-skill: phase-3-mockup
pdca-phase: plan
task-template: "[Phase-2] {feature}"Phase 2: Coding Convention
> Define code writing rules
Purpose
Maintain consistent code style. Especially important when collaborating with AI - clarify what style AI should use when writing code.
What to Do in This Phase
1. **Naming Rules**: Variables, functions, files, folder names 2. **Code Style**: Indentation, quotes, semicolons, etc. 3. **Structure Rules**: Folder structure, file separation criteria 4. **Pattern Definition**: Frequently used code patterns
Deliverables
Project Root/
├── CONVENTIONS.md # Full conventions
└── docs/01-plan/
├── naming.md # Naming rules
└── structure.md # Structure rulesPDCA Application
- **Plan**: Identify necessary convention items
- **Design**: Design detailed rules
- **Do**: Write convention documents
- **Check**: Review consistency/practicality
- **Act**: Finalize and proceed to Phase 3
Level-wise Application
| Level | Application Level | |-------|------------------| | Starter | Basic (essential rules only) | | Dynamic | Extended (including API, state management) | | Enterprise | Extended (per-service rules) |
Core Convention Items
Naming
- Components: PascalCase
- Functions: camelCase
- Constants: UPPER_SNAKE_CASE
- Files: kebab-case or PascalCase
Folder Structure
src/
├── components/ # Reusable components
├── features/ # Feature modules
├── hooks/ # Custom hooks
├── utils/ # Utilities
└── types/ # Type definitions
---
Environment Variable Convention
Why Define at Design Stage?
❌ Organizing env vars just before deployment
→ Missing variables, naming inconsistency, deployment delays
✅ Establish convention at design stage
→ Consistent naming, clear categorization, fast deployment
Environment Variable Naming Rules
| Prefix | Purpose | Exposure Scope | Example | |--------|---------|----------------|---------| | `NEXT_PUBLIC_` | Client-exposed | Browser | `NEXT_PUBLIC_API_URL` | | `DB_` | Database | Server only | `DB_HOST`, `DB_PASSWORD` | | `API_` | External API keys | Server only | `API_STRIPE_SECRET` | | `AUTH_` | Authentication | Server only | `AUTH_SECRET`, `AUTH_GOOGLE_ID` | | `SMTP_` | Email service | Server only | `SMTP_HOST`, `SMTP_PASSWORD` | | `STORAGE_` | File storage | Server only | `STORAGE_S3_BUCKET` |
⚠️ Security Principles
- Never expose anything except NEXT_PUBLIC_* to client
- API keys and passwords must be server-only variables
- Never commit sensitive info in .env files
.env File Structure
Project Root/
├── .env.example # Template (in Git, values empty)
├── .env.local # Local development (Git ignored)
├── .env.development # Development env defaults
├── .env.staging # Staging env defaults
├── .env.production # Production defaults (no sensitive info)
└── .env.test # Test environment
.env.example Template
# .env.example - This file is included in Git
# Set actual values in .env.local
# ===== App Settings =====
NODE_ENV=development
NEXT_PUBLIC_APP_URL=http://localhost:3000
# ===== Database =====
DB_HOST=
DB_PORT=5432
DB_NAME=
DB_USER=
DB_PASSWORD=
# ===== Authentication =====
AUTH_SECRET= # openssl rand -base64 32
AUTH_GOOGLE_ID=
AUTH_GOOGLE_SECRET=
# ===== External Services =====
NEXT_PUBLIC_API_URL=
API_STRIPE_SECRET=
SMTP_HOST=
SMTP_USER=
SMTP_PASSWORD=
Environment-wise Value Classification
| Variable Type | .env.example | .env.local | CI/CD Secrets | |---------------|:------------:|:----------:|:-------------:| | App URL | Template | Local value | Per-env value | | API endpoints | Template | Local/dev | Per-env value | | DB password | Empty | Local value | ✅ Secrets | | API keys | Empty | Test key | ✅ Secrets | | JWT Secret | Empty | Local value | ✅ Secrets |
Environment Variable Validation
// lib/env.ts - Validate env vars at app startup
import { z } from 'zod';
const envSchema = z.object({
// Required
DATABASE_URL: z.string().url(),
AUTH_SECRET: z.string().min(32),
// Optional (with defaults)
NODE_ENV: z.enum(['development', 'staging', 'production']).default('development'),
// Client-exposed
NEXT_PUBLIC_APP_URL: z.string().url(),
});
// Validation and type inference
export const env = envSchema.parse(process.env);
// Type-safe usage
// env.DATABASE_URL ← autocomplete supportedEnvironment Variable Checklist
- [ ] **Naming Consistency**
- [ ] Follow prefix rules (NEXT_PUBLIC_, DB_, API_, etc.)
- [ ] Use UPPER_SNAKE_CASE
- [ ] **File Structure**
- [ ] Create .env.example (template)
- [ ] Register .env.local in .gitignore
- [ ] Separate .env files per environment
- [ ] **Security**
- [ ] Classify sensitive info
- [ ] Verify client-exposed variables
- [ ] Organize Secrets list (for Phase 9 deployment)
---
Clean Architecture Principles
Why Define at Design Stage?
Clean Architecture = Code resilient to change
❌ Developing without architecture
→ Spaghetti code, multiple file changes for each modification
✅ Define layers at design stage
→ Separation of concerns, easy testing, easy maintenance
4-Layer Architecture (Recommended)
src/
├── presentation/ # or app/, pages/
│ ├── components/ # UI components
Read more
name: phase-2-convention
context: fork
background: false
classification: workflow
classification-reason: Process automation persists regardless of model advancement
deprecation-risk: none
effort: medium
description: |
Define coding rules, conventions, and standards for AI collaboration.
Triggers: convention, coding style, lint, rules
agent: bkit:pipeline-guide
allowed-tools:
- Read
- Write
- Glob
- Grep
user-invocable: false
imports:
- ${PLUGIN_ROOT}/templates/pipeline/phase-2-convention.template.md
- ${PLUGIN_ROOT}/templates/shared/naming-conventions.md
next-skill: phase-3-mockup
pdca-phase: plan
task-template: "[Phase-2] {feature}"Phase 2: Coding Convention
> Define code writing rules
Purpose
Maintain consistent code style. Especially important when collaborating with AI - clarify what style AI should use when writing code.
What to Do in This Phase
1. **Naming Rules**: Variables, functions, files, folder names 2. **Code Style**: Indentation, quotes, semicolons, etc. 3. **Structure Rules**: Folder structure, file separation criteria 4. **Pattern Definition**: Frequently used code patterns
Deliverables
Project Root/
├── CONVENTIONS.md # Full conventions
└── docs/01-plan/
├── naming.md # Naming rules
└── structure.md # Structure rulesPDCA Application
- **Plan**: Identify necessary convention items
- **Design**: Design detailed rules
- **Do**: Write convention documents
- **Check**: Review consistency/practicality
- **Act**: Finalize and proceed to Phase 3
Level-wise Application
| Level | Application Level | |-------|------------------| | Starter | Basic (essential rules only) | | Dynamic | Extended (including API, state management) | | Enterprise | Extended (per-service rules) |
Core Convention Items
Naming
- Components: PascalCase
- Functions: camelCase
- Constants: UPPER_SNAKE_CASE
- Files: kebab-case or PascalCase
Folder Structure
src/ ├── components/ # Reusable components ├── features/ # Feature modules ├── hooks/ # Custom hooks ├── utils/ # Utilities └── types/ # Type definitions
---
Environment Variable Convention
Why Define at Design Stage?
❌ Organizing env vars just before deployment → Missing variables, naming inconsistency, deployment delays ✅ Establish convention at design stage → Consistent naming, clear categorization, fast deployment
Environment Variable Naming Rules
| Prefix | Purpose | Exposure Scope | Example | |--------|---------|----------------|---------| | `NEXT_PUBLIC_` | Client-exposed | Browser | `NEXT_PUBLIC_API_URL` | | `DB_` | Database | Server only | `DB_HOST`, `DB_PASSWORD` | | `API_` | External API keys | Server only | `API_STRIPE_SECRET` | | `AUTH_` | Authentication | Server only | `AUTH_SECRET`, `AUTH_GOOGLE_ID` | | `SMTP_` | Email service | Server only | `SMTP_HOST`, `SMTP_PASSWORD` | | `STORAGE_` | File storage | Server only | `STORAGE_S3_BUCKET` |
⚠️ Security Principles - Never expose anything except NEXT_PUBLIC_* to client - API keys and passwords must be server-only variables - Never commit sensitive info in .env files
.env File Structure
Project Root/ ├── .env.example # Template (in Git, values empty) ├── .env.local # Local development (Git ignored) ├── .env.development # Development env defaults ├── .env.staging # Staging env defaults ├── .env.production # Production defaults (no sensitive info) └── .env.test # Test environment
.env.example Template
# .env.example - This file is included in Git # Set actual values in .env.local # ===== App Settings ===== NODE_ENV=development NEXT_PUBLIC_APP_URL=http://localhost:3000 # ===== Database ===== DB_HOST= DB_PORT=5432 DB_NAME= DB_USER= DB_PASSWORD= # ===== Authentication ===== AUTH_SECRET= # openssl rand -base64 32 AUTH_GOOGLE_ID= AUTH_GOOGLE_SECRET= # ===== External Services ===== NEXT_PUBLIC_API_URL= API_STRIPE_SECRET= SMTP_HOST= SMTP_USER= SMTP_PASSWORD=
Environment-wise Value Classification
| Variable Type | .env.example | .env.local | CI/CD Secrets | |---------------|:------------:|:----------:|:-------------:| | App URL | Template | Local value | Per-env value | | API endpoints | Template | Local/dev | Per-env value | | DB password | Empty | Local value | ✅ Secrets | | API keys | Empty | Test key | ✅ Secrets | | JWT Secret | Empty | Local value | ✅ Secrets |
Environment Variable Validation
// lib/env.ts - Validate env vars at app startup
import { z } from 'zod';
const envSchema = z.object({
// Required
DATABASE_URL: z.string().url(),
AUTH_SECRET: z.string().min(32),
// Optional (with defaults)
NODE_ENV: z.enum(['development', 'staging', 'production']).default('development'),
// Client-exposed
NEXT_PUBLIC_APP_URL: z.string().url(),
});
// Validation and type inference
export const env = envSchema.parse(process.env);
// Type-safe usage
// env.DATABASE_URL ← autocomplete supportedEnvironment Variable Checklist
- [ ] **Naming Consistency**
- [ ] Follow prefix rules (NEXT_PUBLIC_, DB_, API_, etc.)
- [ ] Use UPPER_SNAKE_CASE
- [ ] **File Structure**
- [ ] Create .env.example (template)
- [ ] Register .env.local in .gitignore
- [ ] Separate .env files per environment
- [ ] **Security**
- [ ] Classify sensitive info
- [ ] Verify client-exposed variables
- [ ] Organize Secrets list (for Phase 9 deployment)
---
Clean Architecture Principles
Why Define at Design Stage?
Clean Architecture = Code resilient to change ❌ Developing without architecture → Spaghetti code, multiple file changes for each modification ✅ Define layers at design stage → Separation of concerns, easy testing, easy maintenance
4-Layer Architecture (Recommended)
src/ ├── presentation/ # or app/, pages/ │ ├── components/ # UI components
A Claude Code plugin that verifies AI-generated code against its own design specs. Three commands. Anyone — even someone vibe-coding for the first time — can ship robust, production-quality software.
Other skills on bkit.
More skills from other plugins.
agentmail
Use your assigned AgentMail inbox to read email tasks, explicitly send or reply, and check delivery. Provided automatically by…
adr-create
Create a new Architecture Decision Record with sequential numbering and AgentDB registration
Questions about phase-2-convention.
- Which coding agents can use phase-2-convention?
- phase-2-convention installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.

