跳到主要内容
知仓学习社ZHICANG

reflect

>

读凭据执行命令改身份文件写文件联网严重 1 · 高危 23haddock-development/claude-reflect-system

它会碰到什么

扫了多少21 个文本文件,133 KB
它会碰到什么读凭据执行命令改身份文件写文件联网
命中总数34 处
命中统计严重 1 · 高 23 · 中 8 · 低 1
逐条看命中(24 条严重或高危)
  • 严重 scripts/scope_analyzer.py:28cred-paths
    (r'\.env\.', 2),
  • scripts/extract_signals.py:249cred-envread
    if os.getenv('TRANSCRIPT_PATH'):
  • scripts/extract_signals.py:250cred-envread
    return os.getenv('TRANSCRIPT_PATH')
  • scripts/extract_signals.py:252cred-envread
    session_dir = Path(os.getenv('SESSION_DIR', Path.home() / '.claude' / 'session-env')).expanduser()
  • scripts/learning_ledger.py:88exec-spawn
    result = subprocess.run(
  • scripts/promote_learning.py:3identity-write
    Promote Learning - Move skill-level learnings to global CLAUDE.md
  • scripts/promote_learning.py:6identity-write
    for promotion to the global CLAUDE.md file.
  • scripts/promote_learning.py:25identity-write
    GLOBAL_CLAUDE_MD = Path.home() / ".claude" / "CLAUDE.md"
  • scripts/promote_learning.py:44identity-write
    """Preview what would be added to CLAUDE.md."""
  • scripts/promote_learning.py:56identity-write
    # Generate the entry for CLAUDE.md
  • scripts/promote_learning.py:69identity-write
    """Format learning as CLAUDE.md entry."""
  • scripts/promote_learning.py:89identity-write
    backup_path = BACKUP_DIR / f"CLAUDE.md.{timestamp}.bak"
  • scripts/promote_learning.py:95identity-write
    """Promote a learning to global CLAUDE.md."""
  • scripts/promote_learning.py:121identity-write
    # Append to CLAUDE.md
  • scripts/reflect.py:24cred-envread
    transcript_path = os.getenv('TRANSCRIPT_PATH') or (sys.argv[1] if len(sys.argv) > 1 else None)
  • scripts/reflect.py:114cred-envread
    session_id = os.getenv('SESSION_ID', 'unknown')
  • scripts/reflect.py:115cred-envread
    auto_reflected = os.getenv('AUTO_REFLECTED', 'false')
  • scripts/reflect.py:126exec-spawn
    subprocess.run(['git', 'add', '.'], cwd=skills_dir, check=True, capture_output=True)
  • scripts/reflect.py:129exec-spawn
    subprocess.run(['git', 'commit', '-m', commit_message], cwd=skills_dir, check=True, capture_output=True)
  • scripts/semantic_detector.py:83exec-spawn
    result = subprocess.run(
  • USER_GUIDE.md:587identity-config-write
    cat ~/.claude/settings.local.json | grep -A 10 hooks
  • USER_GUIDE.md:591identity-config-write
    "hooks": {
  • USER_GUIDE.md:593identity-config-write
    "hooks": [{
  • USER_GUIDE.md:986identity-config-write
    ~/.claude/settings.local.json          # Hook-Konfiguration

这一栏是扫描器报的事实,不是结论。命中多不等于有毒(安全工具、规则库、示例脚本本来就会包含危险写法),命中少也不等于干净。它和你手上的凭据、文件、网络有什么关系,需要你自己看。

技能内容

Reflect - Self-Improving Skills

Overview

This skill enables Claude Code to learn from conversations by analyzing corrections,

approvals, and patterns, then proposing updates to relevant skills. It implements

a "correct once, never again" learning system.

Usage Modes

1. Manual Reflection (/reflect)

Trigger analysis of the current conversation:

/reflect [skill-name]
  • Without skill-name: Analyzes all skills used in conversation
  • With skill-name: Focuses on specific skill

2. Automatic Reflection

When enabled via /reflect-on, runs automatically at session end via Stop hook.

3. Toggle Commands

  • /reflect-on - Enable automatic reflection
  • /reflect-off - Disable automatic reflection
  • /reflect-status - Show current configuration

Confidence Levels

HIGH - Explicit corrections:

  • User contradicts Claude's approach with specific alternative
  • Pattern: "Don't do X, do Y instead"
  • Action: Direct updates with deprecation warnings

MEDIUM - Approvals and patterns:

  • User approves specific approach
  • Pattern succeeds multiple times
  • Action: Add to "Best Practices" section

LOW - Observations:

  • User questions or suggests alternatives
  • Pattern: "Have you considered..." or "Why not try..."
  • Action: Add to "Considerations" section

Workflow

  1. Signal Detection - Scan transcript for corrections/patterns
  2. Context Analysis - Extract 5-message context around signals
  3. Skill Mapping - Match signals to relevant skills
  4. Change Proposal - Generate diff of proposed updates
  5. User Review - Interactive approval with natural language editing
  6. Application - Safe YAML/markdown updates with backups
  7. Git Commit - Automatic commit with descriptive message

Scripts

Core Engine

  • scripts/reflect.py - Main orchestration logic
  • scripts/extract_signals.py - Pattern detection engine
  • scripts/update_skill.py - Safe skill file updates
  • scripts/present_review.py - Interactive review interface

Automation

  • scripts/hook-stop.sh - Stop hook integration
  • scripts/toggle-on.sh - Enable auto-reflection
  • scripts/toggle-off.sh - Disable auto-reflection
  • scripts/toggle-status.sh - Show status

Safety Features

  • Timestamped backups before all edits
  • YAML validation before writing
  • Lock files prevent concurrent runs
  • Graceful error handling with rollback
  • Git status checks before commits

References

See references/signal-patterns.md for detailed pattern library.

想直接用这个技能?

本站把开放许可(MIT / Apache 等)的技能按仓库打包整理到网盘,点一下转存到你自己的网盘,不用一个个从 GitHub 拉。许可未声明的技能只给原始仓库链接,不打包。

它属于哪个仓库

星标★ 378
本站分层T2
该仓技能数2
原文件路径reflect/SKILL.md

同一个仓库里的其他技能

看这个仓库的全部 2 个技能