[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6CD2S47CNQBS505Q8F3WHBT":3,"skill-same:01M6CD2S47CNQBS505Q8F3WHBT":123},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":23,"publishedAt":43,"linkOnly":44,"markdownContent":45,"markdownBody":46,"frontMatter":47,"refName":56,"commitSha":57,"skillDirectory":58,"forksCount":14,"repositoryHtmlUrl":59,"repositoryHomepageUrl":6,"ownerHtmlUrl":60,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":61,"install":62,"resources":75},"01M6CD2S47CNQBS505Q8F3WHBT","session-init",null,"Create protocol-compliant JSON session logs with verification-based enforcement. Autonomous operation with auto-incremented session numbers and objective derivation from git state. Use when starting any new session.","loriensleafs\u002Fbrain","loriensleafs","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F315385?v=4","01M6CCYZETMCJPTHNS258YRCBC","Peter Kloss","01M6CCYZK25T8516A39S9PCJT7",0,"MIT","https:\u002F\u002Fgithub.com\u002Floriensleafs\u002Fbrain\u002Fblob\u002Fmain\u002Ftemplates\u002Fskills\u002Fsession-init\u002FSKILL.md",[18],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42],"init","session init","session","git","state","protocol","verification","logs","compliance","new session","json","autonomous","implementer","create","use","devops","auto","enforcement","automation","2026-11-10 10:12:30",false,"---\nname: session-init\ndescription: Create protocol-compliant JSON session logs with verification-based enforcement. Autonomous operation with auto-incremented session numbers and objective derivation from git state. Use when starting any new session.\nlicense: MIT\nagents:\n  - implementer\n  - devops\nmodel: claude-sonnet-4-6\nmetadata:\n  version: 1.0.0\n  timelessness: 7\u002F10\n  domains:\n    - session-protocol\n    - compliance\n    - automation\n  type: initialization\n---\n\n# Session Init\n\nCreate protocol-compliant session logs with verification-based enforcement.\n\n---\n\n## Quick Start\n\n### Automated (Recommended)\n\n```bash\nbun run ${CLAUDE_SKILL_DIR}\u002Fscripts\u002Fnew_session_log.ts\n```\n\nThe script will:\n\n1. Prompt for session number and objective\n2. Auto-detect git state (branch, commit, date)\n3. Read canonical template from SESSION-PROTOCOL.md\n4. Write session log with EXACT template format\n5. Validate immediately with validate_session_json\n6. Exit nonzero on validation failure\n\n### Manual (If Needed)\n\n```text\n\u002Fsession-init\n```\n\nFollow the manual workflow below if the automated script doesn't meet your needs.\n\n---\n\n## Triggers\n\n| Phrase | Action |\n|--------|--------|\n| `\u002Fsession-init` | Create new session log |\n| `create session log` | Natural language activation |\n| `start new session` | Alternative trigger |\n| `initialize session` | Alternative trigger |\n\n| Input | Output | Quality Gate |\n|-------|--------|--------------|\n| Session number, objective | Validated session log file | Exit code 0 from validation |\n\n---\n\n## When to Use\n\nUse this skill when:\n\n- Starting any new work session\n- Need a protocol-compliant session log\n- Previous session log failed CI validation and need a fresh start\n\nUse [session-log-fixer](..\u002Fsession-log-fixer\u002FSKILL.md) instead when:\n\n- An existing session log has validation errors that need repair\n- CI failed with \"Session protocol validation failed\"\n\nUse [session-migration](..\u002Fsession-migration\u002FSKILL.md) instead when:\n\n- Converting old markdown session logs to JSON format\n\n## Why This Skill Exists\n\n**Problem**: Every PR starts with malformed session logs that fail CI validation.\n\n**Root Cause**: Agents generate session logs from LLM memory instead of copying the canonical template from SESSION-PROTOCOL.md. This causes variations like:\n\n- Missing `(COMPLETE ALL before closing)` text in Session End header\n- Wrong heading levels (`##` vs `###`)\n- Missing sections\n\n**Solution**: Verification-based enforcement following the proven Brain initialization pattern.\n\n---\n\n## Session Naming Protocol\n\n**Format**: `YYYY-MM-DD-session-NN.json`\n\nThe script automatically generates human-readable filenames by extracting up to 5 keywords from the session objective using NLP heuristics:\n\n- **Remove stop words**: Common words like \"the\", \"a\", \"to\", \"for\" are filtered out\n- **Keep domain terms**: Technical verbs like \"implement\", \"debug\", \"fix\", \"refactor\" are preserved\n- **Convert to kebab-case**: Words are joined with hyphens for readability\n- **Limit to 5 keywords**: Most relevant terms from the start of the objective\n\n### Examples\n\n| Session Objective | Generated Filename |\n|-------------------|--------------------|\n| \"Debug recurring session validation failures\" | `2026-01-06-session-374-debug-recurring-session-validation-failures.md` |\n| \"Implement OAuth 2.0 authentication flow\" | `2026-01-06-session-375-implement-oauth-authentication-flow.md` |\n| \"Fix test coverage gaps in UserService\" | `2026-01-06-session-376-fix-test-coverage-gaps-userservice.md` |\n| \"Refactor PaymentProcessor for better error handling\" | `2026-01-06-session-377-refactor-paymentprocessor-better-error-handling.md` |\n\n### Benefits\n\n- **Human-readable discovery**: Browse session history with `ls .agents\u002Fsessions\u002F` and instantly understand content\n- **Grep-friendly search**: Find sessions by topic with `grep -l \"oauth\" .agents\u002Fsessions\u002F*.json`\n- **Self-documenting**: No need to open files to understand what each session covers\n- **Chronological order**: YYYY-MM-DD prefix preserves time-based sorting\n- **Pattern identification**: Keyword clustering reveals recurring themes across sessions\n\n---\n\n## Process Overview\n\n```text\nUser Request: \u002Fsession-init\n    |\n    v\n+---------------------------------------------+\n| Phase 1: GATHER INPUTS                      |\n| - Prompt for session number                 |\n| - Prompt for objective                      |\n| - Auto-detect: date (YYYY-MM-DD)           |\n| - Auto-detect: branch (git branch)         |\n| - Auto-detect: commit (git log)            |\n| - Auto-detect: git status                  |\n+---------------------------------------------+\n    |\n    v\n+---------------------------------------------+\n| Phase 2: READ CANONICAL TEMPLATE            |\n| - Read .agents\u002FSESSION-PROTOCOL.md         |\n| - Extract template (lines 494-612)         |\n| - Preserve EXACT formatting                |\n| - Critical: Keep \"(COMPLETE ALL before     |\n|   closing)\" text in Session End header     |\n+---------------------------------------------+\n    |\n    v\n+---------------------------------------------+\n| Phase 3: POPULATE TEMPLATE                  |\n| - Replace NN with session number           |\n| - Replace YYYY-MM-DD with date             |\n| - Replace [branch name] with actual branch |\n| - Replace [SHA] with commit hash           |\n| - Replace [objective] with user input      |\n| - Replace [clean\u002Fdirty] with git status    |\n+---------------------------------------------+\n    |\n    v\n+---------------------------------------------+\n| Phase 4: WRITE SESSION LOG                  |\n| - Generate descriptive filename with        |\n|   keywords from objective                   |\n| - Write to .agents\u002Fsessions\u002FYYYY-MM-DD-    |\n|   session-NN-keyword1-keyword2-...md       |\n| - Preserve all template sections           |\n+---------------------------------------------+\n    |\n    v\n+---------------------------------------------+\n| Phase 5: IMMEDIATE VALIDATION               |\n| - Run validate_session_json             |\n| - Report validation result                 |\n| - If FAIL: show errors, allow retry       |\n| - If PASS: confirm success                 |\n+---------------------------------------------+\n    |\n    v\nProtocol-Compliant Session Log\n```\n\n---\n\n## Workflow\n\n### Step 1: Gather Session Information\n\nPrompt user for required inputs:\n\n```text\nWhat is the session number? (e.g., 375)\nWhat is the session objective? (e.g., \"Implement session-init skill\")\n```\n\nAuto-detect from environment:\n\n```bash\n# Current date\ndate +%Y-%m-%d\n# or PowerShell: Get-Date -Format \"yyyy-MM-dd\"\n\n# Current branch\ngit branch --show-current\n\n# Starting commit\ngit log --oneline -1\n\n# Git status\ngit status --short\n```\n\n### Step 2: Read Canonical Template\n\n**CRITICAL**: Use the new_session_log.ts script to read the template from SESSION-PROTOCOL.md.\n\n```bash\nbun run ${CLAUDE_SKILL_DIR}\u002Fscripts\u002Fnew_session_log.ts\n```\n\n**DO NOT** generate the template from memory or read specific line numbers. The script extracts the canonical template dynamically:\n\n- Header levels (`##` vs `###`)\n- Table structure with pipe separators\n- Checkbox format `[ ]`\n- Comment blocks `\u003C!-- -->`\n- **CRITICAL**: `### Session End (COMPLETE ALL before closing)` header text\n\n### Step 3: Populate Template Variables\n\nReplace placeholders with actual values:\n\n| Placeholder | Replace With |\n|-------------|--------------|\n| `NN` | Session number (e.g., 375) |\n| `YYYY-MM-DD` | Current date |\n| `[branch name]` | Git branch name |\n| `[SHA]` | Starting commit hash |\n| `[What this session aims to accomplish]` | User-provided objective |\n| `[clean\u002Fdirty]` | Git status result |\n\nLeave these unchanged:\n\n- All checklist items `[ ]` (unchecked)\n- Evidence columns with placeholder text\n- Comment blocks\n\n### Step 4: Write Session Log File\n\nWrite the populated session log to a file with descriptive naming:\n\n**Filename Format**: `YYYY-MM-DD-session-NN.json`\n\nThe script automatically:\n\n1. Extracts up to 5 keywords from the objective\n2. Filters out common stop words (the, a, to, for, etc.)\n3. Converts to kebab-case\n4. Generates human-readable filename\n\n**Example**:\n\nFor objective \"Debug recurring session validation failures\", the filename becomes:\n`2026-01-06-session-374-debug-recurring-session-validation-failures.md`\n\nConstruct filename: `.agents\u002Fsessions\u002FYYYY-MM-DD-session-NN.json`\n\nExample: `.agents\u002Fsessions\u002F.agents\u002Fsessions\u002F2026-01-05-session-375.json`\n\nWrite the populated template to this file.\n\n### Step 5: Validate Immediately\n\nRun validation script:\n\n```bash\nbun run scripts\u002Fvalidate_session_json.ts \".agents\u002Fsessions\u002FYYYY-MM-DD-session-NN.json\"\n```\n\nCheck exit code:\n\n| Exit Code | Meaning | Action |\n|-----------|---------|--------|\n| 0 | PASS | Confirm success, agent proceeds |\n| 1 | FAIL | Show errors, offer to retry |\n\n---\n\n## Verification Checklist\n\nBefore reporting success:\n\n- [ ] Session number provided by user\n- [ ] Objective provided by user\n- [ ] Template read from SESSION-PROTOCOL.md (NOT generated from memory)\n- [ ] All template sections present\n- [ ] Session End header includes `(COMPLETE ALL before closing)`\n- [ ] File written to correct path `.agents\u002Fsessions\u002FYYYY-MM-DD-session-NN.json`\n- [ ] Validation script executed\n- [ ] Validation result is PASS (exit code 0)\n\n---\n\n## Anti-Patterns\n\n| Avoid | Why | Instead |\n|-------|-----|---------|\n| Generating template from memory | Will miss exact formatting | Read from SESSION-PROTOCOL.md |\n| Skipping validation | Won't catch errors until CI | Validate immediately |\n| Hardcoding template in skill | Template may change | Always read from canonical source |\n| Pre-checking boxes | Defeats verification purpose | Leave all unchecked |\n| Using `## Session End` | Missing required text | Use `### Session End (COMPLETE ALL before closing)` |\n\n---\n\n## Example Output\n\n**Success**:\n\n```text\nSession log created and validated\n\n  File: .agents\u002Fsessions\u002F.agents\u002Fsessions\u002F2026-01-05-session-375.json\n  Validation: PASS\n  Branch: feat\u002Fsession-init\n  Commit: abc1234\n\nNext: Complete Session Start checklist in the session log\n```\n\n**Failure**:\n\n```text\nSession log created but validation FAILED\n\n  File: .agents\u002Fsessions\u002F.agents\u002Fsessions\u002F2026-01-05-session-375.json\n  Validation: FAIL\n  Errors:\n    - Missing Session End checklist header\n\nRun: bun run scripts\u002Fvalidate_session_json.ts \".agents\u002Fsessions\u002F.agents\u002Fsessions\u002F2026-01-05-session-375.json\" \n\nFix the issues and re-validate.\n```\n\n---\n\n## Related Skills\n\n| Skill | Relationship |\n|-------|--------------|\n| [log-fixer](..\u002Flog-fixer\u002F) | Reactive fix after failure (this skill prevents need) |\n| [qa-eligibility](..\u002Fqa-eligibility\u002F) | QA eligibility checking (different purpose) |\n\n---\n\n## Scripts\n\n| Script | Purpose | Exit Codes |\n|--------|---------|------------|\n| [new_session_log.ts](scripts\u002Fnew_session_log.ts) | Automated session log creation with validation | 0=success, 1=error |\n| [new_session_log_json.ts](scripts\u002Fnew_session_log_json.ts) | Simplified JSON session log creation | 0=success, 1=error |\n\n### Example Usage\n\n**Automated (Recommended)**:\n\n```bash\n# Create session log with parameters\nbun run ${CLAUDE_SKILL_DIR}\u002Fscripts\u002Fnew_session_log.ts --session-number 375 --objective \"Implement feature X\"\n\n# Skip validation\nbun run ${CLAUDE_SKILL_DIR}\u002Fscripts\u002Fnew_session_log.ts --session-number 375 --objective \"Implement feature X\" --skip-validation\n\n# Simplified JSON-only version\nbun run ${CLAUDE_SKILL_DIR}\u002Fscripts\u002Fnew_session_log_json.ts --session-number 375 --objective \"Implement feature X\"\n```\n\n---\n\n## References\n\n- [SESSION-PROTOCOL.md](.agents\u002FSESSION-PROTOCOL.md) - Canonical template source\n- Validation script (external, in repo scripts\u002F)\n- [Template Extraction](references\u002Ftemplate-extraction.md) - How to extract template\n- [Validation Patterns](references\u002Fvalidation-patterns.md) - Common validation issues\n\n---\n\n## Pattern: Verification-Based Enforcement\n\nThis skill follows the same pattern as Brain initialization:\n\n| Aspect | Brain Init | Session Init |\n|--------|-------------|--------------|\n| **Verification** | Tool output in transcript | Validation script exit code |\n| **Feedback** | Immediate (tool response) | Immediate (validation output) |\n| **Enforcement** | Cannot proceed without output | Cannot claim success without pass |\n| **Compliance Rate** | 100% (never violated) | Target: 100% |\n\n**Why it works**:\n\n- Reads canonical template from file (single source of truth)\n- Auto-populates git state (reduces manual errors)\n- Validates immediately with same script as CI (instant feedback)\n- Cannot skip validation (built into skill workflow)\n- Provides actionable error messages if validation fails\n","# Session Init\n\nCreate protocol-compliant session logs with verification-based enforcement.\n\n---\n\n## Quick Start\n\n### Automated (Recommended)\n\n```bash\nbun run ${CLAUDE_SKILL_DIR}\u002Fscripts\u002Fnew_session_log.ts\n```\n\nThe script will:\n\n1. Prompt for session number and objective\n2. Auto-detect git state (branch, commit, date)\n3. Read canonical template from SESSION-PROTOCOL.md\n4. Write session log with EXACT template format\n5. Validate immediately with validate_session_json\n6. Exit nonzero on validation failure\n\n### Manual (If Needed)\n\n```text\n\u002Fsession-init\n```\n\nFollow the manual workflow below if the automated script doesn't meet your needs.\n\n---\n\n## Triggers\n\n| Phrase | Action |\n|--------|--------|\n| `\u002Fsession-init` | Create new session log |\n| `create session log` | Natural language activation |\n| `start new session` | Alternative trigger |\n| `initialize session` | Alternative trigger |\n\n| Input | Output | Quality Gate |\n|-------|--------|--------------|\n| Session number, objective | Validated session log file | Exit code 0 from validation |\n\n---\n\n## When to Use\n\nUse this skill when:\n\n- Starting any new work session\n- Need a protocol-compliant session log\n- Previous session log failed CI validation and need a fresh start\n\nUse [session-log-fixer](..\u002Fsession-log-fixer\u002FSKILL.md) instead when:\n\n- An existing session log has validation errors that need repair\n- CI failed with \"Session protocol validation failed\"\n\nUse [session-migration](..\u002Fsession-migration\u002FSKILL.md) instead when:\n\n- Converting old markdown session logs to JSON format\n\n## Why This Skill Exists\n\n**Problem**: Every PR starts with malformed session logs that fail CI validation.\n\n**Root Cause**: Agents generate session logs from LLM memory instead of copying the canonical template from SESSION-PROTOCOL.md. This causes variations like:\n\n- Missing `(COMPLETE ALL before closing)` text in Session End header\n- Wrong heading levels (`##` vs `###`)\n- Missing sections\n\n**Solution**: Verification-based enforcement following the proven Brain initialization pattern.\n\n---\n\n## Session Naming Protocol\n\n**Format**: `YYYY-MM-DD-session-NN.json`\n\nThe script automatically generates human-readable filenames by extracting up to 5 keywords from the session objective using NLP heuristics:\n\n- **Remove stop words**: Common words like \"the\", \"a\", \"to\", \"for\" are filtered out\n- **Keep domain terms**: Technical verbs like \"implement\", \"debug\", \"fix\", \"refactor\" are preserved\n- **Convert to kebab-case**: Words are joined with hyphens for readability\n- **Limit to 5 keywords**: Most relevant terms from the start of the objective\n\n### Examples\n\n| Session Objective | Generated Filename |\n|-------------------|--------------------|\n| \"Debug recurring session validation failures\" | `2026-01-06-session-374-debug-recurring-session-validation-failures.md` |\n| \"Implement OAuth 2.0 authentication flow\" | `2026-01-06-session-375-implement-oauth-authentication-flow.md` |\n| \"Fix test coverage gaps in UserService\" | `2026-01-06-session-376-fix-test-coverage-gaps-userservice.md` |\n| \"Refactor PaymentProcessor for better error handling\" | `2026-01-06-session-377-refactor-paymentprocessor-better-error-handling.md` |\n\n### Benefits\n\n- **Human-readable discovery**: Browse session history with `ls .agents\u002Fsessions\u002F` and instantly understand content\n- **Grep-friendly search**: Find sessions by topic with `grep -l \"oauth\" .agents\u002Fsessions\u002F*.json`\n- **Self-documenting**: No need to open files to understand what each session covers\n- **Chronological order**: YYYY-MM-DD prefix preserves time-based sorting\n- **Pattern identification**: Keyword clustering reveals recurring themes across sessions\n\n---\n\n## Process Overview\n\n```text\nUser Request: \u002Fsession-init\n    |\n    v\n+---------------------------------------------+\n| Phase 1: GATHER INPUTS                      |\n| - Prompt for session number                 |\n| - Prompt for objective                      |\n| - Auto-detect: date (YYYY-MM-DD)           |\n| - Auto-detect: branch (git branch)         |\n| - Auto-detect: commit (git log)            |\n| - Auto-detect: git status                  |\n+---------------------------------------------+\n    |\n    v\n+---------------------------------------------+\n| Phase 2: READ CANONICAL TEMPLATE            |\n| - Read .agents\u002FSESSION-PROTOCOL.md         |\n| - Extract template (lines 494-612)         |\n| - Preserve EXACT formatting                |\n| - Critical: Keep \"(COMPLETE ALL before     |\n|   closing)\" text in Session End header     |\n+---------------------------------------------+\n    |\n    v\n+---------------------------------------------+\n| Phase 3: POPULATE TEMPLATE                  |\n| - Replace NN with session number           |\n| - Replace YYYY-MM-DD with date             |\n| - Replace [branch name] with actual branch |\n| - Replace [SHA] with commit hash           |\n| - Replace [objective] with user input      |\n| - Replace [clean\u002Fdirty] with git status    |\n+---------------------------------------------+\n    |\n    v\n+---------------------------------------------+\n| Phase 4: WRITE SESSION LOG                  |\n| - Generate descriptive filename with        |\n|   keywords from objective                   |\n| - Write to .agents\u002Fsessions\u002FYYYY-MM-DD-    |\n|   session-NN-keyword1-keyword2-...md       |\n| - Preserve all template sections           |\n+---------------------------------------------+\n    |\n    v\n+---------------------------------------------+\n| Phase 5: IMMEDIATE VALIDATION               |\n| - Run validate_session_json             |\n| - Report validation result                 |\n| - If FAIL: show errors, allow retry       |\n| - If PASS: confirm success                 |\n+---------------------------------------------+\n    |\n    v\nProtocol-Compliant Session Log\n```\n\n---\n\n## Workflow\n\n### Step 1: Gather Session Information\n\nPrompt user for required inputs:\n\n```text\nWhat is the session number? (e.g., 375)\nWhat is the session objective? (e.g., \"Implement session-init skill\")\n```\n\nAuto-detect from environment:\n\n```bash\n# Current date\ndate +%Y-%m-%d\n# or PowerShell: Get-Date -Format \"yyyy-MM-dd\"\n\n# Current branch\ngit branch --show-current\n\n# Starting commit\ngit log --oneline -1\n\n# Git status\ngit status --short\n```\n\n### Step 2: Read Canonical Template\n\n**CRITICAL**: Use the new_session_log.ts script to read the template from SESSION-PROTOCOL.md.\n\n```bash\nbun run ${CLAUDE_SKILL_DIR}\u002Fscripts\u002Fnew_session_log.ts\n```\n\n**DO NOT** generate the template from memory or read specific line numbers. The script extracts the canonical template dynamically:\n\n- Header levels (`##` vs `###`)\n- Table structure with pipe separators\n- Checkbox format `[ ]`\n- Comment blocks `\u003C!-- -->`\n- **CRITICAL**: `### Session End (COMPLETE ALL before closing)` header text\n\n### Step 3: Populate Template Variables\n\nReplace placeholders with actual values:\n\n| Placeholder | Replace With |\n|-------------|--------------|\n| `NN` | Session number (e.g., 375) |\n| `YYYY-MM-DD` | Current date |\n| `[branch name]` | Git branch name |\n| `[SHA]` | Starting commit hash |\n| `[What this session aims to accomplish]` | User-provided objective |\n| `[clean\u002Fdirty]` | Git status result |\n\nLeave these unchanged:\n\n- All checklist items `[ ]` (unchecked)\n- Evidence columns with placeholder text\n- Comment blocks\n\n### Step 4: Write Session Log File\n\nWrite the populated session log to a file with descriptive naming:\n\n**Filename Format**: `YYYY-MM-DD-session-NN.json`\n\nThe script automatically:\n\n1. Extracts up to 5 keywords from the objective\n2. Filters out common stop words (the, a, to, for, etc.)\n3. Converts to kebab-case\n4. Generates human-readable filename\n\n**Example**:\n\nFor objective \"Debug recurring session validation failures\", the filename becomes:\n`2026-01-06-session-374-debug-recurring-session-validation-failures.md`\n\nConstruct filename: `.agents\u002Fsessions\u002FYYYY-MM-DD-session-NN.json`\n\nExample: `.agents\u002Fsessions\u002F.agents\u002Fsessions\u002F2026-01-05-session-375.json`\n\nWrite the populated template to this file.\n\n### Step 5: Validate Immediately\n\nRun validation script:\n\n```bash\nbun run scripts\u002Fvalidate_session_json.ts \".agents\u002Fsessions\u002FYYYY-MM-DD-session-NN.json\"\n```\n\nCheck exit code:\n\n| Exit Code | Meaning | Action |\n|-----------|---------|--------|\n| 0 | PASS | Confirm success, agent proceeds |\n| 1 | FAIL | Show errors, offer to retry |\n\n---\n\n## Verification Checklist\n\nBefore reporting success:\n\n- [ ] Session number provided by user\n- [ ] Objective provided by user\n- [ ] Template read from SESSION-PROTOCOL.md (NOT generated from memory)\n- [ ] All template sections present\n- [ ] Session End header includes `(COMPLETE ALL before closing)`\n- [ ] File written to correct path `.agents\u002Fsessions\u002FYYYY-MM-DD-session-NN.json`\n- [ ] Validation script executed\n- [ ] Validation result is PASS (exit code 0)\n\n---\n\n## Anti-Patterns\n\n| Avoid | Why | Instead |\n|-------|-----|---------|\n| Generating template from memory | Will miss exact formatting | Read from SESSION-PROTOCOL.md |\n| Skipping validation | Won't catch errors until CI | Validate immediately |\n| Hardcoding template in skill | Template may change | Always read from canonical source |\n| Pre-checking boxes | Defeats verification purpose | Leave all unchecked |\n| Using `## Session End` | Missing required text | Use `### Session End (COMPLETE ALL before closing)` |\n\n---\n\n## Example Output\n\n**Success**:\n\n```text\nSession log created and validated\n\n  File: .agents\u002Fsessions\u002F.agents\u002Fsessions\u002F2026-01-05-session-375.json\n  Validation: PASS\n  Branch: feat\u002Fsession-init\n  Commit: abc1234\n\nNext: Complete Session Start checklist in the session log\n```\n\n**Failure**:\n\n```text\nSession log created but validation FAILED\n\n  File: .agents\u002Fsessions\u002F.agents\u002Fsessions\u002F2026-01-05-session-375.json\n  Validation: FAIL\n  Errors:\n    - Missing Session End checklist header\n\nRun: bun run scripts\u002Fvalidate_session_json.ts \".agents\u002Fsessions\u002F.agents\u002Fsessions\u002F2026-01-05-session-375.json\" \n\nFix the issues and re-validate.\n```\n\n---\n\n## Related Skills\n\n| Skill | Relationship |\n|-------|--------------|\n| [log-fixer](..\u002Flog-fixer\u002F) | Reactive fix after failure (this skill prevents need) |\n| [qa-eligibility](..\u002Fqa-eligibility\u002F) | QA eligibility checking (different purpose) |\n\n---\n\n## Scripts\n\n| Script | Purpose | Exit Codes |\n|--------|---------|------------|\n| [new_session_log.ts](scripts\u002Fnew_session_log.ts) | Automated session log creation with validation | 0=success, 1=error |\n| [new_session_log_json.ts](scripts\u002Fnew_session_log_json.ts) | Simplified JSON session log creation | 0=success, 1=error |\n\n### Example Usage\n\n**Automated (Recommended)**:\n\n```bash\n# Create session log with parameters\nbun run ${CLAUDE_SKILL_DIR}\u002Fscripts\u002Fnew_session_log.ts --session-number 375 --objective \"Implement feature X\"\n\n# Skip validation\nbun run ${CLAUDE_SKILL_DIR}\u002Fscripts\u002Fnew_session_log.ts --session-number 375 --objective \"Implement feature X\" --skip-validation\n\n# Simplified JSON-only version\nbun run ${CLAUDE_SKILL_DIR}\u002Fscripts\u002Fnew_session_log_json.ts --session-number 375 --objective \"Implement feature X\"\n```\n\n---\n\n## References\n\n- [SESSION-PROTOCOL.md](.agents\u002FSESSION-PROTOCOL.md) - Canonical template source\n- Validation script (external, in repo scripts\u002F)\n- [Template Extraction](references\u002Ftemplate-extraction.md) - How to extract template\n- [Validation Patterns](references\u002Fvalidation-patterns.md) - Common validation issues\n\n---\n\n## Pattern: Verification-Based Enforcement\n\nThis skill follows the same pattern as Brain initialization:\n\n| Aspect | Brain Init | Session Init |\n|--------|-------------|--------------|\n| **Verification** | Tool output in transcript | Validation script exit code |\n| **Feedback** | Immediate (tool response) | Immediate (validation output) |\n| **Enforcement** | Cannot proceed without output | Cannot claim success without pass |\n| **Compliance Rate** | 100% (never violated) | Target: 100% |\n\n**Why it works**:\n\n- Reads canonical template from file (single source of truth)\n- Auto-populates git state (reduces manual errors)\n- Validates immediately with same script as CI (instant feedback)\n- Cannot skip validation (built into skill workflow)\n- Provides actionable error messages if validation fails\n",{"name":5,"model":48,"agents":49,"license":15,"metadata":50,"description":7},"claude-sonnet-4-6",[36,39],{"type":51,"domains":52,"version":54,"timelessness":55},"initialization",[53,32,42],"session-protocol","1.0.0","7\u002F10","main","2bd10cb7ca989f88dbf338b57957763718eda59b","templates\u002Fskills\u002Fsession-init","https:\u002F\u002Fgithub.com\u002Floriensleafs\u002Fbrain","https:\u002F\u002Fgithub.com\u002Floriensleafs","2026-03-11 23:51:59",{"source":8,"skillName":5,"commands":63,"prompt":73,"zipAvailable":74},[64,67,70],{"tool":65,"command":66},"npx","npx skills add loriensleafs\u002Fbrain --skill session-init",{"tool":68,"command":69},"bunx","bunx skills add loriensleafs\u002Fbrain --skill session-init",{"tool":71,"command":72},"pnpm","pnpm dlx skills add loriensleafs\u002Fbrain --skill session-init","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Floriensleafs\u002Fbrain\u002Fblob\u002Fmain\u002Ftemplates\u002Fskills\u002Fsession-init\u002FSKILL.md",true,[76,82,88,92,96,100,104,108,111,115,119],{"path":77,"resourceType":78,"resourceTypeDesc":79,"sizeBytes":80,"sourceHtmlUrl":81},"CLAUDE.md","REFERENCE","参考文档",170,"https:\u002F\u002Fgithub.com\u002Floriensleafs\u002Fbrain\u002Fblob\u002Fmain\u002Ftemplates\u002Fskills\u002Fsession-init\u002FCLAUDE.md",{"path":83,"resourceType":84,"resourceTypeDesc":85,"sizeBytes":86,"sourceHtmlUrl":87},"lib\u002Fcommon_types.ts","SCRIPT","脚本",341,"https:\u002F\u002Fgithub.com\u002Floriensleafs\u002Fbrain\u002Fblob\u002Fmain\u002Ftemplates\u002Fskills\u002Fsession-init\u002Flib\u002Fcommon_types.ts",{"path":89,"resourceType":84,"resourceTypeDesc":85,"sizeBytes":90,"sourceHtmlUrl":91},"lib\u002Fgit_helpers.ts",1805,"https:\u002F\u002Fgithub.com\u002Floriensleafs\u002Fbrain\u002Fblob\u002Fmain\u002Ftemplates\u002Fskills\u002Fsession-init\u002Flib\u002Fgit_helpers.ts",{"path":93,"resourceType":84,"resourceTypeDesc":85,"sizeBytes":94,"sourceHtmlUrl":95},"lib\u002Findex.ts",339,"https:\u002F\u002Fgithub.com\u002Floriensleafs\u002Fbrain\u002Fblob\u002Fmain\u002Ftemplates\u002Fskills\u002Fsession-init\u002Flib\u002Findex.ts",{"path":97,"resourceType":84,"resourceTypeDesc":85,"sizeBytes":98,"sourceHtmlUrl":99},"lib\u002Ftemplate_helpers.ts",4428,"https:\u002F\u002Fgithub.com\u002Floriensleafs\u002Fbrain\u002Fblob\u002Fmain\u002Ftemplates\u002Fskills\u002Fsession-init\u002Flib\u002Ftemplate_helpers.ts",{"path":101,"resourceType":78,"resourceTypeDesc":79,"sizeBytes":102,"sourceHtmlUrl":103},"references\u002Ftemplate-extraction.md",3099,"https:\u002F\u002Fgithub.com\u002Floriensleafs\u002Fbrain\u002Fblob\u002Fmain\u002Ftemplates\u002Fskills\u002Fsession-init\u002Freferences\u002Ftemplate-extraction.md",{"path":105,"resourceType":78,"resourceTypeDesc":79,"sizeBytes":106,"sourceHtmlUrl":107},"references\u002Fvalidation-patterns.md",5068,"https:\u002F\u002Fgithub.com\u002Floriensleafs\u002Fbrain\u002Fblob\u002Fmain\u002Ftemplates\u002Fskills\u002Fsession-init\u002Freferences\u002Fvalidation-patterns.md",{"path":109,"resourceType":84,"resourceTypeDesc":85,"sizeBytes":80,"sourceHtmlUrl":110},"scripts\u002FCLAUDE.md","https:\u002F\u002Fgithub.com\u002Floriensleafs\u002Fbrain\u002Fblob\u002Fmain\u002Ftemplates\u002Fskills\u002Fsession-init\u002Fscripts\u002FCLAUDE.md",{"path":112,"resourceType":84,"resourceTypeDesc":85,"sizeBytes":113,"sourceHtmlUrl":114},"scripts\u002Fnew_session_log_json.ts",7290,"https:\u002F\u002Fgithub.com\u002Floriensleafs\u002Fbrain\u002Fblob\u002Fmain\u002Ftemplates\u002Fskills\u002Fsession-init\u002Fscripts\u002Fnew_session_log_json.ts",{"path":116,"resourceType":84,"resourceTypeDesc":85,"sizeBytes":117,"sourceHtmlUrl":118},"scripts\u002Fnew_session_log.ts",9426,"https:\u002F\u002Fgithub.com\u002Floriensleafs\u002Fbrain\u002Fblob\u002Fmain\u002Ftemplates\u002Fskills\u002Fsession-init\u002Fscripts\u002Fnew_session_log.ts",{"path":120,"resourceType":84,"resourceTypeDesc":85,"sizeBytes":121,"sourceHtmlUrl":122},"tests\u002Ftest_session_init.test.ts",6906,"https:\u002F\u002Fgithub.com\u002Floriensleafs\u002Fbrain\u002Fblob\u002Fmain\u002Ftemplates\u002Fskills\u002Fsession-init\u002Ftests\u002Ftest_session_init.test.ts",[124,139,155,178,195,217],{"skillNo":125,"name":126,"nameZh":6,"description":127,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":128,"categories":129,"keywords":130,"publishedAt":43},"01M6CD3KHDHPR633RVP95G4XWN","validation-authority","Treat upstream validators as authoritative. Align local config to them. Use when validation fails unexpectedly, before modifying validator behavior, or when tempted to change upstream tool code.","https:\u002F\u002Fgithub.com\u002Floriensleafs\u002Fbrain\u002Fblob\u002Fmain\u002Ftemplates\u002Fskills\u002Fvalidation-authority\u002FSKILL.md",[],[131,132,133,38,36,134,135,136,137,138],"validation authority","validation","config","behavior","tool","architect","code","change",{"skillNo":140,"name":141,"nameZh":6,"description":142,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":143,"categories":144,"keywords":145,"publishedAt":43},"01M6CD3H29Q8FWN9YETT8YVQTS","using-brain-memory","Guidance for using Brain semantic memory effectively. Applies Zettelkasten atomic note principles with observations and relations. Use when deciding whether to query or create notes, structuring note content, or understanding the semantic knowledge graph.","https:\u002F\u002Fgithub.com\u002Floriensleafs\u002Fbrain\u002Fblob\u002Fmain\u002Ftemplates\u002Fskills\u002Fusing-forgetful-memory\u002FSKILL.md",[],[146,147,148,37,149,150,151,38,152,153,154],"using brain memory","memory","content","notes","graph","guidance","context","knowledge","knowledge graph",{"skillNo":156,"name":157,"nameZh":6,"description":158,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":159,"categories":160,"keywords":161,"publishedAt":43},"01M6CD3E2KTTMNSWXRJAAZA7D1","threat-modeling","Structured security analysis using OWASP Four-Question Framework and STRIDE methodology. Generates threat matrices with risk ratings, mitigations, and prioritization. Use for attack surface analysis, security architecture review, or when asking what can go wrong.","https:\u002F\u002Fgithub.com\u002Floriensleafs\u002Fbrain\u002Fblob\u002Fmain\u002Ftemplates\u002Fskills\u002Fthreat-modeling\u002FSKILL.md",[],[162,163,164,38,165,136,166,167,168,169,170,171,172,173,174,175,176,177],"threat","threat modeling","prioritization","question","architecture review","stride","analysis","risk","owasp","methodology","framework","security analysis","architecture","security","go","review",{"skillNo":179,"name":180,"nameZh":6,"description":181,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":182,"categories":183,"keywords":185,"publishedAt":43},"01M6CD3BC6G0Q2MDNW6X51XHBQ","taste-lints","Custom lints with agent-readable remediation instructions. Enforces taste invariants (file size, naming conventions, structured logging, complexity) and surfaces errors that agents can act on directly. Use when writing or reviewing code to catch style violations early.","https:\u002F\u002Fgithub.com\u002Floriensleafs\u002Fbrain\u002Fblob\u002Fmain\u002Ftemplates\u002Fskills\u002Ftaste-lints\u002FSKILL.md",[184],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[186,36,187,188,38,189,190,191,192,193,137,194],"taste lints","surfaces","complexity","instructions","remediation","file","logging","qa","writing",{"skillNo":196,"name":197,"nameZh":6,"description":198,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":199,"categories":200,"keywords":201,"publishedAt":43},"01M6CD37Z7VD22BH42TG0GM66V","style-enforcement","Validate code against style rules from .editorconfig, StyleCop.json, and Directory.Build.props. Detects line ending violations, naming convention issues, indentation problems, and charset mismatches across C#, Python, TypeScript, and JavaScript. Produces JSON reports for pre-commit hooks and CI pipelines.","https:\u002F\u002Fgithub.com\u002Floriensleafs\u002Fbrain\u002Fblob\u002Fmain\u002Ftemplates\u002Fskills\u002Fstyle-enforcement\u002FSKILL.md",[],[202,41,203,204,205,206,36,207,34,208,209,210,193,211,137,212,213,214,215,216],"style enforcement","ci","pipelines","directory","hooks","Rules","pre-commit","editorconfig","reports","issues","validate","commit","javascript","python","typescript",{"skillNo":218,"name":219,"nameZh":6,"description":220,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":221,"categories":222,"keywords":223,"publishedAt":43},"01M6CD35JW73TPMCZBF9DTDEE8","steering-matcher","Match file paths against steering file glob patterns to determine applicable steering guidance. Use when orchestrator needs to inject context-aware guidance based on files being modified.","https:\u002F\u002Fgithub.com\u002Floriensleafs\u002Fbrain\u002Fblob\u002Fmain\u002Ftemplates\u002Fskills\u002Fsteering-matcher\u002FSKILL.md",[],[224,38,225,226,152,227,151,191],"steering matcher","files","haiku","orchestrator"]