reflect
>
它会碰到什么
扫了多少21 个文本文件,133 KB
它会碰到什么读凭据执行命令改身份文件写文件联网
命中总数34 处
命中统计严重 1 · 高 23 · 中 8 · 低 1
逐条看命中(24 条严重或高危)
- 严重
scripts/scope_analyzer.py:28cred-paths(r'\.env\.', 2),
- 高
scripts/extract_signals.py:249cred-envreadif os.getenv('TRANSCRIPT_PATH'): - 高
scripts/extract_signals.py:250cred-envreadreturn os.getenv('TRANSCRIPT_PATH') - 高
scripts/extract_signals.py:252cred-envreadsession_dir = Path(os.getenv('SESSION_DIR', Path.home() / '.claude' / 'session-env')).expanduser() - 高
scripts/learning_ledger.py:88exec-spawnresult = subprocess.run(
- 高
scripts/promote_learning.py:3identity-writePromote Learning - Move skill-level learnings to global CLAUDE.md
- 高
scripts/promote_learning.py:6identity-writefor promotion to the global CLAUDE.md file.
- 高
scripts/promote_learning.py:25identity-writeGLOBAL_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-writebackup_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-envreadtranscript_path = os.getenv('TRANSCRIPT_PATH') or (sys.argv[1] if len(sys.argv) > 1 else None) - 高
scripts/reflect.py:114cred-envreadsession_id = os.getenv('SESSION_ID', 'unknown') - 高
scripts/reflect.py:115cred-envreadauto_reflected = os.getenv('AUTO_REFLECTED', 'false') - 高
scripts/reflect.py:126exec-spawnsubprocess.run(['git', 'add', '.'], cwd=skills_dir, check=True, capture_output=True)
- 高
scripts/reflect.py:129exec-spawnsubprocess.run(['git', 'commit', '-m', commit_message], cwd=skills_dir, check=True, capture_output=True)
- 高
scripts/semantic_detector.py:83exec-spawnresult = subprocess.run(
- 高
USER_GUIDE.md:587identity-config-writecat ~/.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
- Signal Detection - Scan transcript for corrections/patterns
- Context Analysis - Extract 5-message context around signals
- Skill Mapping - Match signals to relevant skills
- Change Proposal - Generate diff of proposed updates
- User Review - Interactive approval with natural language editing
- Application - Safe YAML/markdown updates with backups
- Git Commit - Automatic commit with descriptive message
Scripts
Core Engine
scripts/reflect.py- Main orchestration logicscripts/extract_signals.py- Pattern detection enginescripts/update_skill.py- Safe skill file updatesscripts/present_review.py- Interactive review interface
Automation
scripts/hook-stop.sh- Stop hook integrationscripts/toggle-on.sh- Enable auto-reflectionscripts/toggle-off.sh- Disable auto-reflectionscripts/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 拉。许可未声明的技能只给原始仓库链接,不打包。