agentleFS
ww-w-aiww-w-ai/bkit-codex/.agents/skills/phase-2-convention/SKILL.md

phase-2-convention

Skill69 starsChanged 8 months agoApache-2.0View on GitHub

Phase 2: Coding Conventions and Naming Rules. Establish consistent coding standards, file naming, and project structure. Next: $phase-3-mockup. Triggers: convention, coding standard, naming rule, style guide, lint, 코딩 컨벤션, 네이밍 규칙, 코드 스타일, コーディング規約, 命名規則, 编码规范, 命名规则, convención de código, convention de codage, Kodierkonvention Do NOT use for: data modeling (use $phase-1-schema), UI design (use $phase-3-mockup).

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Git Commit Conventions: - Commit message format

    line 35
  2. Distinctive:

    When conventions are established, proceed to $phase-3-mockup for UI/UX design.

    line 116

≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Phase 2: Coding Conventions

Establish coding standards before writing application code.

Purpose

Phase 2 sets the rules everyone (human and AI) follows. Consistent conventions prevent confusion and reduce code review friction.

Actions

ActionDescriptionExample
startBegin Phase 2$phase-2-convention start
generateGenerate convention doc$phase-2-convention generate
lintCheck convention compliance$phase-2-convention lint

Deliverables

  1. Convention Document - docs/01-plan/convention.md
  2. ESLint/Prettier Config - Automated enforcement
  3. File Naming Rules - Directory and file naming patterns
  4. Component Naming Rules - UI component conventions
  5. Git Commit Conventions - Commit message format

Process

Step 1: Language & Framework Conventions

## TypeScript Conventions
- Strict mode enabled
- No `any` type (use `unknown` if needed)
- Interfaces over Types for object shapes
- Enum for fixed value sets
- Async/await over .then() chains

Step 2: Naming Rules

ElementConventionExample
Files (components)PascalCaseUserProfile.tsx
Files (utilities)camelCaseformatDate.ts
Files (styles)kebab-caseuser-profile.module.css
VariablescamelCaseuserName, isActive
ConstantsUPPER_SNAKEMAX_RETRY_COUNT
Types/InterfacesPascalCaseUserProfile, ApiResponse
HookscamelCase with useuseAuth, useQuery
ComponentsPascalCaseUserCard, NavBar
API routeskebab-case/api/user-profile
Databasesnake_caseuser_profile, created_at

Step 3: Directory Structure Rules

  • Group by feature, not by type
  • Max 3 levels deep
  • index.ts for barrel exports
  • tests/ next to source files

Step 4: Git Conventions

<type>(<scope>): <description>

Types: feat, fix, docs, style, refactor, test, chore
Scope: component or module name
Description: imperative mood, lowercase, no period

Examples:
- feat(auth): add social login support
- fix(api): handle null response from user endpoint

Step 5: Code Style Enforcement

{
  "extends": ["next/core-web-vitals", "prettier"],
  "rules": {
    "no-console": "warn",
    "no-unused-vars": "error",
    "@typescript-eslint/no-explicit-any": "error"
  }
}

Convention Patterns

See references/naming-conventions.md for detailed patterns.

Output Location

docs/01-plan/
├── convention.md      # Full convention document
project/
├── .eslintrc.json     # ESLint config
├── .prettierrc        # Prettier config
└── .editorconfig      # Editor config

Next Phase

When conventions are established, proceed to $phase-3-mockup for UI/UX design.

Common Mistakes

MistakeSolution
No automated enforcementSet up ESLint + Prettier from day 1
Too many rulesStart minimal, add rules as needed
Inconsistent namingUse a naming decision table
No commit conventionsUse commitlint with husky
Mixing conventionsOne language = one convention set

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

Reviews can't be read right now.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.