AgentSkillsCN

language-enforcement

强制所有面向用户的内容均以日语输出。 适用场景: - 当智能体的输出必须采用日语时; - 当您需要确保各次回复的语言一致性时; - 当您需要以日语生成规格说明或文档时。 触发短语:日语、日本語、语言模式、输出语言。

SKILL.md
--- frontmatter
name: language-enforcement
description: |
  Enforces Japanese language output for all user-facing content.

  Use when:
  - Agent outputs need to be in Japanese
  - Verifying language consistency across responses
  - Generating specifications or documentation in Japanese

  Trigger phrases: Japanese, 日本語, language mode, output language

Language Enforcement Skill

This skill ensures all user-facing output is in Japanese while maintaining code readability.

Rule Hierarchy

L1 Hard Rules (MUST - Never Break)

RuleScope
All user responses must be 100% JapaneseUser interaction
Specification/design document body must be JapaneseDocumentation
Error messages and explanations must be JapaneseError handling
NEVER output English explanations to usersAll outputs

L2 Soft Rules (Should - Default Behavior)

RuleOverride Condition
Code comments should be JapaneseWhen collaborating with English-only team
Technical terms may include English in parenthesesWhen term is ambiguous
Commit messages should be JapaneseWhen repo convention is English

L3 Guidelines (Consider - Recommendations)

GuidelineRationale
Keep variable/function names in EnglishProgramming language conventions
Keep file paths and URLs unchangedSystem compatibility
Keep JSON keys in EnglishAPI compatibility
Keep code identifiers in EnglishIDE/tooling support

Technical Term Mapping

Use this mapping for consistent terminology:

English日本語Context
specification仕様書Documents
architectureアーキテクチャDesign
implementation実装Code
refactoringリファクタリングCode changes
dependency依存関係Packages
repositoryリポジトリGit
deploymentデプロイOperations
endpointエンドポイントAPI
middlewareミドルウェアBackend
componentコンポーネントFrontend
hookフックEvents/React
state management状態管理Frontend
authentication認証Security
authorization認可Security
validationバリデーションInput
serializationシリアライズData
cachingキャッシュPerformance
loggingロギングObservability
monitoringモニタリングObservability
testingテストQA

Output Format Examples

Good Example (Correct)

markdown
## アーキテクチャ設計

### 概要
このフィーチャーは既存の認証パターンを拡張し、OAuth 2.0をサポートします。

### 実装方針
1. `src/services/auth.ts:45` の既存パターンに従う
2. 新規エンドポイントを `src/api/oauth.ts` に追加
3. 型定義を `src/types/oauth.ts` に作成

### コード例
```typescript
// OAuth認証のコールバック処理
export async function handleOAuthCallback(
  code: string,
  provider: OAuthProvider
): Promise<AuthResult> {
  // プロバイダーからトークンを取得
  const token = await exchangeCodeForToken(code, provider);
  return { success: true, token };
}

トレードオフ

  • JWT vs セッション: JWTを採用(スケーラビリティ重視)
code

### Bad Example (Incorrect)

```markdown
## Architecture Design

### Overview
This feature extends existing auth patterns to support OAuth 2.0.

### Implementation Approach
1. Follow existing pattern at `src/services/auth.ts:45`
2. Add new endpoints to `src/api/oauth.ts`

Validation Checklist

Before returning output, verify:

  • All explanatory text is in Japanese
  • Technical terms use consistent Japanese terminology
  • Code identifiers remain in English
  • File paths and references are unchanged
  • No English-only sentences in explanations

Integration with Other Skills

This skill works with:

  • subagent-contract: Ensures subagent outputs follow language rules
  • spec-philosophy: Applies to specification documents
  • evaluator-optimizer: Quality checks include language verification

Edge Cases

When English is Acceptable

  1. Code blocks: Variable names, function names, class names
  2. File paths: src/components/Button.tsx
  3. Technical references: file:line format
  4. URLs and external links: Keep original format
  5. JSON/YAML keys: { "status": "success" }
  6. Error codes: ERR_AUTH_001
  7. CLI commands: npm install, git commit

When to Use English Parenthetical

For clarity, use format: 日本語 (English)

markdown
認証 (authentication) と認可 (authorization) の違いを理解することが重要です。

Only use when:

  • Term is ambiguous in Japanese
  • First introduction of technical concept
  • User explicitly asks for English term