Skip to content

JikiME-ADK Rules Reference

This is the rules system documentation for JikiME-ADK.


Overview

JikiME-ADK provides consistent development standards through 13 rule files:

Rules Map

┌─────────────────────────────────────────────────────────────────┐
│                     JikiME-ADK Rules                             │
├─────────────────────────────────────────────────────────────────┤
│                                                                  │
│  ┌─ Core Rules (Required) ──────────────────────────────────┐  │
│  │                                                            │  │
│  │  core.md          HARD rules (language, execution, output) │  │
│  │  agents.md        Agent delegation rules                   │  │
│  │  quality.md       Quality gates                            │  │
│  │  interaction.md   User interaction                         │  │
│  │                                                            │  │
│  └────────────────────────────────────────────────────────────┘  │
│                                                                  │
│  ┌─ Development Rules ──────────────────────────────────────┐  │
│  │                                                            │  │
│  │  coding-style.md  Coding style                             │  │
│  │  git-workflow.md  Git workflow                             │  │
│  │  testing.md       Testing guidelines                       │  │
│  │  security.md      Security guidelines                      │  │
│  │  patterns.md      Common patterns                          │  │
│  │                                                            │  │
│  └────────────────────────────────────────────────────────────┘  │
│                                                                  │
│  ┌─ System Rules ───────────────────────────────────────────┐  │
│  │                                                            │  │
│  │  hooks.md         Hook system                              │  │
│  │  performance.md   Performance optimization                 │  │
│  │  skills.md        Skill discovery/management               │  │
│  │  web-search.md    Web search protocol                      │  │
│  │                                                            │  │
│  └────────────────────────────────────────────────────────────┘  │
│                                                                  │
└─────────────────────────────────────────────────────────────────┘

Core Rules

core.md - Core Rules

Purpose: Defines HARD rules that must be followed

Language Rules

RuleDescription
[HARD] Language-Aware ResponsesAll user responses in conversation_language
[HARD] Internal CommunicationAgent-to-agent communication in English
[HARD] Code CommentsFollow code_comments setting (default: English)

Execution Rules

RuleDescription
[HARD] Parallel ExecutionIndependent tool calls without dependencies run in parallel
[HARD] No XML in User ResponsesXML tags must not be shown to users

Output Format Rules

RuleDescription
[HARD] Markdown RequiredAlways use Markdown in user responses
[HARD] XML ReservedXML tags only for internal agent data transfer

Checklist

Verify before responding:

  • [ ] Response is in user's conversation_language
  • [ ] Independent tasks are parallelized
  • [ ] No XML tags in response
  • [ ] Markdown formatting applied
  • [ ] URLs verified before inclusion

agents.md - Agent Delegation Rules

Purpose: Defines when and how to delegate to agents

Rules by Command Type

Type A: Workflow Commands

Commands: /jikime:0-project, /jikime:1-plan, /jikime:2-run, /jikime:3-sync

  • Agent delegation recommended (when expertise needed for complex tasks)
  • Direct tool use allowed (for simple tasks)
  • User interaction only via orchestrator's AskUserQuestion
Type B: Utility Commands

Commands: /jikime:jarvis, /jikime:fix, /jikime:loop, /jikime:test

  • [HARD] Agent delegation required for all implementation/modification tasks
  • Direct tool access allowed only for diagnostics (LSP, tests, linters)
  • All code modifications delegated to specialist agents
  • Applies even after auto compact or session recovery

Reason: Prevents quality degradation during session context loss

Selection Decision Tree

1. Read-only codebase exploration?
   → Use Explore subagent

2. Need external documentation/API research?
   → Use WebSearch, WebFetch, Context7 MCP tools

3. Need domain expertise?
   → Use specialist subagent (backend, frontend, debugger, etc.)

4. Need workflow coordination?
   → Use manager-[workflow] subagent

5. Complex multi-step task?
   → Use manager-strategy subagent

Context Optimization

When delegating to agents:

  • Pass minimal context (spec_id, 3 or fewer key requirements, architecture summary under 200 chars)
  • Exclude background info, reasoning, non-essential details
  • Each agent has independent 200K token session

quality.md - Quality Gates

Purpose: Quality verification rules and checklists for all tasks

HARD Rules Checklist

Required verification before task completion:

  • [ ] All implementation tasks delegated to agents when expertise needed
  • [ ] User response in conversation_language
  • [ ] Independent tasks run in parallel
  • [ ] XML tags not shown to users
  • [ ] URLs verified before inclusion (WebSearch)
  • [ ] Sources cited when using WebSearch

SOFT Rules Checklist

Recommended best practices:

  • [ ] Appropriate agent selected for task
  • [ ] Minimal context passed to agents
  • [ ] Results integrated consistently
  • [ ] Complex tasks delegated to agents (Type B commands)

Violation Detection

ViolationDescription
No Agent ConsiderationNot considering agent delegation for complex implementation requests
Skipped VerificationSkipping quality verification for important changes
Language MismatchIgnoring user's conversation_language

DDD Quality Standards

When using Domain-Driven Development:

  • [ ] Run existing tests before refactoring
  • [ ] Create characterization tests for code without coverage
  • [ ] Preserve behavior with ANALYZE-PRESERVE-IMPROVE cycle
  • [ ] Changes are incremental and verified

TRUST 5 Framework

PrincipleDescription
TestedAppropriate test coverage for all code
ReadableCode is self-documenting and clear
UnifiedConsistent patterns across codebase
SecuredSecurity best practices applied
TrackableChanges documented and traceable

interaction.md - User Interaction Rules

Purpose: User interaction and AskUserQuestion usage rules

Important Constraint

Subagents called via Task() operate in isolated stateless contexts and cannot interact directly with users.

Only orchestrator can use AskUserQuestion - subagents cannot

Correct Workflow Pattern

Step 1: Orchestrator collects user preferences via AskUserQuestion

Step 2: Orchestrator calls Task() with user choices included in prompt

Step 3: Subagent executes with provided parameters (no user interaction)

Step 4: Subagent returns structured response with results

Step 5: Orchestrator uses AskUserQuestion for next decision based on agent response

AskUserQuestion Constraints

ConstraintRule
Options per questionMaximum 4
Emoji usageNo emojis in question text, headers, option labels
LanguageQuestions in user's conversation_language

Clarification Rules

  • If user intent is unclear, clarify before proceeding via AskUserQuestion
  • Collect all necessary user preferences before delegating to agents
  • Do not assume user preferences without confirmation

Development Rules

coding-style.md - Coding Style Rules

Purpose: Quality and style guidelines for consistent, maintainable code

Immutability (CRITICAL)

Always create new objects, never mutate:

javascript
// ❌ WRONG: Mutation
function updateUser(user, name) {
  user.name = name  // MUTATION!
  return user
}

// ✅ CORRECT: Immutability
function updateUser(user, name) {
  return { ...user, name }
}

File Organization

Many small files > Few large files

GuidelineTarget
Lines per file200-400 typical, 800 max
Lines per function< 50 lines
Nesting depth< 4 levels
CohesionHigh (single responsibility)
CouplingLow (minimal dependencies)

Organization Principle: Organize by feature/domain, not by type

# ❌ WRONG: By type
src/
├── components/
├── hooks/
├── services/
└── utils/

# ✅ CORRECT: By feature
src/
├── auth/
│   ├── components/
│   ├── hooks/
│   └── services/
├── users/
└── products/

Error Handling

Always handle errors comprehensively:

typescript
try {
  const result = await riskyOperation()
  return result
} catch (error) {
  console.error('Operation failed:', error)
  throw new Error('Detailed user-friendly message')
}

Naming Conventions

TypeConventionExample
VariablescamelCaseuserName, isActive
FunctionscamelCase, verb prefixgetUserById, validateInput
ClassesPascalCaseUserService, AuthController
ConstantsUPPER_SNAKE_CASEMAX_RETRY_COUNT, API_BASE_URL
Fileskebab-case or camelCaseuser-service.ts, userService.ts

Prohibited Patterns

PatternReason
any type (TypeScript)Defeats type safety
Magic numbersUse named constants
Deep nestingExtract to functions
God objects/functionsSplit by responsibility
Commented-out codeDelete (use git history)

git-workflow.md - Git Workflow Rules

Purpose: Git conventions and workflow guidelines for consistent version control

Commit Message Format

<type>: <description>

<optional body>

Commit Types

TypeDescription
featNew feature
fixBug fix
refactorCode refactoring (no behavior change)
docsDocumentation changes
testAdding/modifying tests
choreMaintenance tasks
perfPerformance improvements
ciCI/CD changes

Branch Naming

<type>/<description>
TypePurpose
feature/New feature
fix/Bug fix
refactor/Code refactoring
docs/Documentation
chore/Maintenance

Prohibited Actions

ActionReason
Force push to main/masterDestroys history
Committing secretsSecurity risk
Large single commitsHard to review/revert
Merge commits on feature branchesComplicates history
Committing build artifactsBloats repository

testing.md - Testing Guidelines

Purpose: Testing best practices applying DDD methodology

Coverage Targets

TypeTargetPriority
Business logic90%+Critical
API endpoints80%+High
UI components70%+Medium
Utilities80%+Medium
Overall80%+Required

DDD Testing Approach

ANALYZE → PRESERVE → IMPROVE
1. ANALYZE
   - Run existing tests
   - Identify test coverage gaps
   - Understand current behavior

2. PRESERVE
   - Write characterization tests for code without coverage
   - Capture current behavior as baseline
   - Ensure no regressions

3. IMPROVE
   - Implement changes
   - Run all tests after each change
   - Add tests for new features

Good Test Principles

PrincipleDescription
FastRun quickly, encourage frequent execution
IsolatedNo dependencies between tests
RepeatableSame results every time
Self-validatingClear pass/fail, no manual verification
TimelyWritten close to code changes

security.md - Security Guidelines

Purpose: Security best practices based on OWASP Top 10 and industry standards

OWASP Top 10 Checklist

1. Injection
typescript
// ❌ CRITICAL: SQL Injection
const query = `SELECT * FROM users WHERE id = ${userId}`

// ✅ SAFE: Parameterized query
const { data } = await supabase.from('users').select('*').eq('id', userId)
2. Broken Authentication
typescript
// ❌ CRITICAL: Plaintext password comparison
if (password === storedPassword) { /* login */ }

// ✅ SAFE: Hash comparison
const isValid = await bcrypt.compare(password, hashedPassword)
3. Sensitive Data Exposure
typescript
// ❌ CRITICAL: Hardcoded secret
const apiKey = "sk-proj-xxxxx"

// ✅ SAFE: Environment variable
const apiKey = process.env.OPENAI_API_KEY
4. XSS
typescript
// ❌ HIGH: XSS vulnerability
element.innerHTML = userInput

// ✅ SAFE: Use textContent
element.textContent = userInput

Secret Management

Environment Variables
typescript
// ❌ NEVER: Hardcoded secret
const apiKey = 'sk-proj-xxxxx'

// ✅ ALWAYS: Environment variable
const apiKey = process.env.API_KEY

if (!apiKey) {
  throw new Error('API_KEY environment variable not set')
}

Security Checklist

Before every commit:

  • [ ] No hardcoded secrets
  • [ ] All user input validated
  • [ ] SQL Injection prevented
  • [ ] XSS prevented
  • [ ] CSRF protection (if applicable)
  • [ ] Authentication verified
  • [ ] Authorization checked
  • [ ] No sensitive data logging
  • [ ] Error messages don't leak information
  • [ ] Dependencies up to date

patterns.md - Common Patterns

Purpose: Reusable code patterns for consistent implementation

API Patterns

Response Format
typescript
interface ApiResponse<T> {
  success: boolean
  data?: T
  error?: {
    code: string
    message: string
    details?: unknown
  }
  meta?: {
    total: number
    page: number
    limit: number
    hasMore: boolean
  }
}

Repository Pattern

typescript
interface Repository<T, ID = string> {
  findAll(filters?: Filters): Promise<T[]>
  findById(id: ID): Promise<T | null>
  create(data: CreateDto<T>): Promise<T>
  update(id: ID, data: UpdateDto<T>): Promise<T>
  delete(id: ID): Promise<void>
  exists(id: ID): Promise<boolean>
}

Validation Pattern

typescript
import { z } from 'zod'

const userSchema = z.object({
  email: z.string().email(),
  password: z.string().min(8).max(100),
  name: z.string().min(1).max(50).optional()
})

type UserInput = z.infer<typeof userSchema>

Pattern Selection Guide

ScenarioPattern
Data accessRepository
Business logicService
Object creationFactory
State managementCustom Hook
Complex componentsCompound
Input validationZod Schema

System Rules

hooks.md - Hook System

Purpose: Claude Code hooks for automated workflows and quality enforcement

Hook Types

TypeTimingPurpose
PreToolUseBefore tool executionValidation, modification, blocking
PostToolUseAfter tool executionAuto-format, checks, logging
NotificationOn specific eventsNotifications, status updates
StopOn session endFinal verification
json
{
  "hooks": {
    "PostToolUse": [
      {
        "matcher": "Edit|Write",
        "condition": "\\.(ts|tsx|js|jsx)$",
        "command": "npx prettier --write $FILE"
      },
      {
        "matcher": "Edit|Write",
        "condition": "\\.(ts|tsx)$",
        "command": "npx tsc --noEmit $FILE 2>&1 | head -20"
      }
    ]
  }
}

Permission Management

LevelAction
SafeRead, Glob, Grep, LSP - Can auto-accept
ReviewEdit, Write, Bash - Review before accepting
Blockrm -rf, sudo, force push - Always block

performance.md - Performance Optimization

Purpose: Efficient Claude Code usage and code performance guidelines

Model Selection Strategy

Haiku (Fast, Cost-efficient)

Use for: Simple code generation, formatting, simple Q&A, workers in multi-agent workflows

Characteristics: 90% of Sonnet capability, 3x cost savings, fastest response

Use for: Main development tasks, complex coding, multi-agent workflow coordination

Characteristics: Optimal balance of capability and cost, strong coding performance

Opus (Maximum Capability)

Use for: Complex architecture decisions, deep reasoning, research analysis

Characteristics: Maximum reasoning depth, best for complex problems, higher cost and latency

Context Window Management

ZoneContextRecommendation
Critical80-100%Avoid large refactoring, complex debugging
Safe0-60%Single file edits, independent utility creation

Algorithm Complexity Targets

- General operations: O(n) or less
- Sorting: O(n log n) acceptable
- Avoid O(n²) in hot paths
- No O(2^n) without explicit approval

skills.md - Skill Discovery and Management

Purpose: Skill discovery, loading, and utilization rules

Skill Discovery Commands

bash
# List all available skills
jikime-adk skill list

# Filter by tag, phase, agent, language
jikime-adk skill list --tag framework
jikime-adk skill list --language typescript

# Search skills by keyword
jikime-adk skill search <keyword>

# Find related skills
jikime-adk skill related <skill-name>

# Detailed skill info
jikime-adk skill info <skill-name> --body

Skill Loading Rules

Automatic Loading (Triggers)
yaml
triggers:
  keywords: ["react", "component"]     # When included in user input
  phases: ["run"]                      # Current development phase
  agents: ["frontend"]                 # Agent in use
  languages: ["typescript"]            # Project language
Progressive Disclosure
LevelContentTokensLoad Timing
Level 1Metadata only~100Agent initialization
Level 2Full body~5KTrigger condition match
Level 3+Bundle filesVariableWhen Claude needs it

Skill Categories

CategoryPrefixExample
Languagejikime-lang-*jikime-lang-typescript, jikime-lang-python
Platformjikime-platform-*jikime-platform-vercel, jikime-platform-supabase
Domainjikime-domain-*jikime-domain-frontend, jikime-domain-backend
Workflowjikime-workflow-*jikime-workflow-spec, jikime-workflow-ddd
Foundationjikime-foundation-*jikime-foundation-claude, jikime-foundation-core

web-search.md - Web Search Protocol

Purpose: Anti-hallucination policy and URL verification rules

HARD Rules

RuleDescription
[HARD] URL VerificationAll URLs verified via WebFetch before inclusion
[HARD] Uncertainty DisclosureUnverified information marked as uncertain
[HARD] Source AttributionInclude actual sources for all web search results

Execution Steps

1. Initial Search
   → Use WebSearch with specific, targeted queries

2. URL Validation
   → Verify each URL via WebFetch before inclusion

3. Response Construction
   → Include only verified URLs with actual search sources

Prohibited Actions

ActionReason
Creating URLs not found in searchGenerates false information
Presenting uncertain info as factMisleads users
Omitting "Sources:" sectionHides information sources

Response Format

Always include when using WebSearch:

markdown
## Answer

[Response with verified information]

## Sources

- [Source Title 1](https://verified-url-1.com)
- [Source Title 2](https://verified-url-2.com)

Rule Priority

HARD vs SOFT Rules

TypeApplicationExample
HARDRequired, no exceptionsLanguage rules, parallel execution, XML prohibition
SOFTRecommended, flexible by situationAgent delegation, quality checks

Actions on Violation

Violation LevelAction
HARD Rule violationImmediate correction required
SOFT Rule violationConsider recommendation
Security violationStop work, immediate correction

Rules Reference Table

Rule FileMain ContentApplies To
core.mdHARD rulesAll tasks
agents.mdAgent delegationCommand execution
quality.mdQuality gatesCode changes
interaction.mdUser interactionOrchestrator responses
coding-style.mdCoding styleCode writing
git-workflow.mdGit conventionsVersion control
testing.mdTesting guideTest writing
security.mdSecurity guideAll code
patterns.mdCommon patternsImplementation
hooks.mdHook systemAutomation
performance.mdPerformance optimizationEfficiency
skills.mdSkill managementSkill loading
web-search.mdWeb searchInformation retrieval

Version: 1.0.0 Last Updated: 2026-01-22

Released under the MIT License.