AgentSkillsCN

bkit-rules

bkit PDCA方法论的核心规则。为文档驱动开发、层级检测、任务分类,以及代码质量标准提供详尽参考。 在需要超出AGENTS.md所提供内容的详细bkit规则时使用此功能。触发:bkit规则、PDCA规则、开发规则、编码标准、 开发规则、编码标准、ルール、规则、reglas、règles、Regeln、regole 请勿用于:特定的PDCA行动(请使用$pdca代替)。

SKILL.md
--- frontmatter
name: bkit-rules
description: |
  Core rules for bkit PDCA methodology. Detailed reference for document-driven
  development, level detection, task classification, and code quality standards.
  Use when you need detailed bkit rules beyond what AGENTS.md provides.
  Triggers: bkit rules, PDCA rules, development rules, coding standards,
  개발 규칙, 코딩 표준, ルール, 规则, reglas, règles, Regeln, regole
  Do NOT use for: specific PDCA actions (use $pdca instead).

bkit Core Rules (Detailed Reference)

Comprehensive rules for bkit's document-driven AI-native development methodology.

1. PDCA Auto-Apply Rules

Task Classification

Classify tasks to determine the appropriate PDCA level:

ClassificationContent SizePDCA LevelAction
Quick Fix< 10 linesNoneExecute immediately
Minor Change< 50 linesRecommendedShow summary, proceed
Feature< 200 linesRequiredCheck/create design doc
Major Feature>= 200 linesRequired + SplitRequire design, split into subtasks

Classification Keywords

ClassificationKeywords
Quick Fixfix, typo, correct, adjust, tweak
Minor Changeimprove, refactor, enhance, optimize, update
Featureadd, create, implement, build, new feature
Major Featureredesign, migrate, architecture, overhaul, rewrite

Design Document Check Flow

Before writing code, follow this decision tree:

  1. Extract feature name from file path or user request
  2. Check: docs/01-plan/features/{feature}.plan.md
  3. Check: docs/02-design/features/{feature}.design.md
  4. Decision:
    • If neither exists: suggest creating a plan first
    • If plan exists but no design: suggest creating a design
    • If both exist: reference design during implementation
    • If task is Quick Fix (<10 lines): skip PDCA, proceed directly

Pre-Write Rules

Before writing or editing any source code file:

  1. Call bkit_pre_write_check(filePath) MCP tool
  2. If response says design document exists: reference it during implementation
  3. If response says no design document: suggest "Shall I create a design first?"
  4. For major changes (>200 lines): ALWAYS suggest creating design first

Post-Write Guidance Rules

After significant code changes:

  1. Call bkit_post_write(filePath, linesChanged) MCP tool
  2. Follow the returned guidance
  3. For features with design docs: suggest gap analysis
  4. Format suggestion: "Consider running gap analysis: $pdca analyze {feature}"

2. Level Detection Rules

Detect project level based on directory structure and config files.

Enterprise (2+ conditions met)

  • kubernetes/, terraform/, k8s/, or infra/ directories exist
  • services/ folder with 2+ services
  • turbo.json or pnpm-workspace.yaml
  • docker-compose.yml
  • .github/workflows/ (CI/CD)

Dynamic (1+ conditions met)

  • lib/bkend/ or src/lib/bkend/ directory
  • .mcp.json with bkend configuration
  • supabase/ folder
  • firebase.json
  • api/ or backend/ directory
  • docker-compose.yml (without K8s indicators)
  • package.json containing: bkend, @supabase, firebase

Starter

None of the above conditions met. Default level for simple projects.

Level-Specific Behavior

AspectStarterDynamicEnterprise
ExplanationFriendly, avoid jargonTechnical but clearConcise, use terms
Code commentsDetailedCore logic onlyArchitecture only
Error handlingStep-by-step guideTechnical solutionsBrief cause + fix
PDCA docsSimpleFeature-specificDetailed architecture
Reference Skill$starter$dynamic$enterprise

Level Upgrade Signals

  • Starter to Dynamic: "Add login", "Save data", "Admin page"
  • Dynamic to Enterprise: "High traffic", "Microservices", "Own server"

3. 8-Language Trigger Keywords

bkit supports trigger detection in 8 languages:

LanguagePlanDesignAnalyzeReport
ENplan, planningdesign, architectureanalyze, verify, checkreport, summary
KO계획, 기획설계, 아키텍처분석, 검증보고서, 요약
JA計画設計分析, 検証報告
ZH计划设计分析, 验证报告
ESplanificardiseñoanalizarinforme
FRplanifierconceptionanalyserrapport
DEplanenEntwurfanalysierenBericht
ITpianificareprogettazioneanalizzarerapporto

Feature Keywords by Language

LanguageFeature RequestBug FixRefactor
ENadd, create, implementfix, bug, errorrefactor, clean
KO추가, 생성, 구현수정, 버그, 오류리팩토링, 정리
JA追加, 作成, 実装修正, バグ, エラーリファクタリング
ZH添加, 创建, 实现修复, 错误重构
ESagregar, creararreglar, errorrefactorizar
FRajouter, créercorriger, erreurrefactoriser
DEhinzufügen, erstellenbeheben, Fehlerrefaktorisieren
ITaggiungere, crearecorreggere, errorerifattorizzare

4. Naming Conventions

Code Naming Rules

TargetRuleExample
ComponentsPascalCaseUserProfile, LoginForm
FunctionscamelCasegetUserById(), handleSubmit()
ConstantsUPPER_SNAKE_CASEMAX_RETRY_COUNT, API_BASE_URL
Types/InterfacesPascalCaseUserProfile, ApiResponse
Files (component)PascalCase.tsxUserProfile.tsx
Files (utility)camelCase.tsformatDate.ts
Folderskebab-caseuser-profile/, auth-provider/

Document Naming Rules

FormatExampleWhen to Use
{feature}.plan.mduser-auth.plan.mdPlan documents
{feature}.design.mduser-auth.design.mdDesign documents
{feature}.analysis.mduser-auth.analysis.mdAnalysis reports
{feature}.report.mduser-auth.report.mdCompletion reports

5. Code Quality Standards

Core Principles

  • DRY: Extract to common function on 2nd use
  • SRP: One function, one responsibility
  • No Hardcoding: Use meaningful constants
  • Extensibility: Write in generalized patterns

Pre-coding Checks

  1. Does similar functionality exist? Search first
  2. Check utils/, hooks/, components/ui/
  3. Reuse if exists; create if not

Self-Check After Coding

  • Same logic exists elsewhere?
  • Can function be reused?
  • Hardcoded values present?
  • Function does only one thing?

When to Refactor

  • Same code appears 2nd time
  • Function exceeds 20 lines
  • if-else nests 3+ levels
  • Same parameters passed to multiple functions

Safety Rules

  • NEVER commit .env, credentials, or secret files
  • ALWAYS validate user input at system boundaries
  • Prefer explicit error handling over silent failures
  • Follow OWASP Top 10 guidelines for security:
    • Input validation (XSS, SQL Injection prevention)
    • Authentication/authorization handling
    • Sensitive data encryption
    • HTTPS enforcement
    • Rate limiting

6. MCP Tools Quick Reference

ToolWhen to CallPriority
bkit_initSession startP0
bkit_analyze_promptFirst user messageP1
bkit_get_statusBefore any PDCA operationP0
bkit_pre_write_checkBefore writing/editing source codeP0
bkit_post_writeAfter significant code changesP1
bkit_complete_phaseWhen a PDCA phase is doneP0
bkit_detect_levelWhen project level is unclearP1
bkit_classify_taskWhen estimating task sizeP1
bkit_pdca_planCreating plan documentP0
bkit_pdca_designCreating design documentP0
bkit_pdca_analyzeRunning gap analysisP1
bkit_pdca_nextSuggesting next phaseP1
bkit_select_templateSelecting PDCA templateP2
bkit_check_deliverablesVerifying phase deliverablesP2
bkit_memory_readReading session memoryP2
bkit_memory_writeWriting session memoryP2

7. Response Style Guidelines

Include bkit Feature Usage Report

When PDCA is active, include at the end of responses:

code
---
bkit Status: {feature} | Phase: {phase} | Match Rate: {rate}%
Next: {suggested next action}

Level-Appropriate Formatting

  • Starter: Include learning points, explain concepts simply
  • Dynamic: Include PDCA status badges, checklists, next-step guidance
  • Enterprise: Include tradeoff analysis, cost impact, deployment considerations