Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsBlogPro
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges
  • Chrome Extension
  • Skill Manager

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Rsi Phase2 Full

ASecurity

RSI Phase 2: Full learned proposal integration

5 stars
0 votes
0 copies
0 views
Added 10/4/2026
ai-agentsgitperformancedocumentation

Security Analysis

A100/100

Scanned 10/4/2026

$npx -y skills add openamer/openamer --skill rsi-phase2-full --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Rsi Phase2 Full?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Rsi Phase2 Full
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/openamer-rsi-phase2-full/badge)](https://www.skillsdirectory.com/skills/openamer-rsi-phase2-full)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
Files
SKILL.md
---
name: rsi-phase2-full
description: "RSI Phase 2: Full learned proposal integration"
---
# RSI Phase 2: Full Learned Proposal Integration

## Overview
Extend `propose_improvement()` to accept optional `model=` parameter and integrate learned proposals from 2B model with safety-rule validation.

## Architecture

### `propose_improvement(target, content, model=None)`

**ALWAYS** run first: Rule-based proposals (P1-P7 expanded)
- P1: CYCLE_SECONDS timing (>300s → suggest 300)
- P1b: Function-level max_tokens defaults
- P2: max_tokens too small (<100 → suggest 200), both module + function level
- P2b: Duplicate rejection of capacity-fn proposals
- P5: Duplicate module-level import dedup
- P3: Missing error context in except blocks
- P4: Stale comment fixes
- P6: Function signatures without type hints
- P7: **Learned proposals from 2B model** (NEW - only if model provided)

**IF model is provided:**
1. Construct prompt with target file + current content (first 2000 chars)
2. Call model via localhost:8081 with:
   - Model: mini-openamer
   - Temperature: 0.7
   - Max tokens: 300
   - Prompt: "You are OpenAmer improving its own code. Target: {target}. Find ONE improvement: make code better, don't break compilation, don't lose bindings. Return: (kind, old_pattern, new_pattern, reason) OR None"
3. Parse response as 4-tuple: (kind, old, new, reason)
4. Validate:
   a. old pattern exists in content (string `old in content`)
   b. Module bindings preserved (AST compare: lost symbols ≤ 2)
   c. kind in allowed set: {"capacity","timing","capacity-fn","logging","comment-fix","hinting","func-param"}
   d. reason is non-empty string
5. IF ALL validation passes: ADD to proposals list
6. IF ANY validation fails: SKIP (rules still work fine)

**Safety never violated:**
- Never break compilation (sandbox py_compile test always runs in apply_and_test)
- Never lose critical bindings (AST gate, max 2 symbols lost allowed)
- Never accept pattern that doesn't exist in content
- Always have non-empty reason

### `_learned_proposal(target, content, model)` Helper
- Constructs prompt, calls model, parses response, validates, returns tuple or None
- Catches all exceptions soft - never crashes the cron job

### Integration with `improve_once()`
```
proposals = propose_improvement(target, content)  # rules only
# THEN, if model available:
if model is not None:
    learned = _learned_proposal(target, content, model)
    if learned:
        # Validate one more time with apply_and_test gates
        proposals.append(learned)
# Then: sandbox, test, switch, log as before
```

## Proposal Kinds (expanded from Phase 1)
- "capacity": max_tokens increase (module level)
- "timing": CYCLE_SECONDS decrease
- "capacity-fn": function-level max_tokens defaults
- "logging": except block + print error context
- "comment-fix": stale comment corrections
- "hinting": add type hints to function signatures
- "func-param": function parameter pattern optimization
- "learned": **NEW** - model-generated improvements (validated by above gates)

## Success Metrics (Phase 2)
- ≥1 learned proposal accepted per 10 rotation cycles
- 0 compilation failures from learned proposals
- 0 binding-loss incidents from learned proposals (>2 lost symbols = reject)
- Proposal acceptance rate stabilizes at 20-30% (model learns what works)
- Phase 3 transition: ≥5 accepted per 10 cycles → extract templates → build permanent rule library

## Rollback
- Existing git/shutil mechanism covers it
- If learned proposal causes issues: `git checkout -- target_file`
- No special handling needed - existing `apply_and_test()` rollback infrastructure

## Phase 3 Transition (1 Monat)
When learned proposals reach ≥5 accepted per 10 cycles:
1. Extract successful pattern templates from accepted learned proposals
2. Convert successful learned patterns into new permanent rule-based patterns (P8, P9, etc.)
3. Build pattern library from model-learned improvements
4. Some learned patterns become permanent rules, reducing model dependency
5. Phase 3: Cross-Domain Metasketart Extraction (fähigkeitenübergreifendes Extrahieren)

## Risks & Mitigations
| Risk | Mitigation |
|---|---|
| Model generates broken code | Validation gates (compilation test, binding check, pattern existence) |
| Model learns bad patterns | Human review of first 20 accepted proposals; acceptance rate monitoring |
| Performance degradation | Only run learned proposals every N cron cycles (e.g., every 3rd) |
| Model unavailable | Graceful fallback: rules only, log "model_unavailable" in improvements.jsonl |
| Prompt injection in model output | Strict output format validation (4-tuple required, kind in allowed set) |

## File Locations
- **Core**: `~/AppData/Local/openamer-laptop/scripts/training/self_improve.py` (enhanced `propose_improvement()`)
- **Skill**: `~/AppData/Local/openamer-laptop/skills/rsi-phase2-full/SKILL.md` (documentation)
- **World Model**: `~/AppData/Local/openamer-laptop/memory/world_model.jsonl` (phase2 design log entry)
- **Logging**: `~/AppData/Local/openamer-laptop/improvements.jsonl` (all proposal attempts logged)

## Phase 2 Implementation Checklist
- [ ] Enhance `propose_improvement()` to accept optional `model=` parameter
- [ ] Implement `_learned_proposal()` with prompt engineering and model call
- [ ] Add validation gates (pattern exist, bindings ≤2 lost, kind allowed, reason non-empty)
- [ ] Integrate with `improve_once()` - learned proposals run after rules
- [ ] Test with model available (localhost:8081) and not available (graceful fallback)
- [ ] Log all learned proposal attempts to `improvements.jsonl`
- [ ] Track acceptance rate over first 50 rotation cycles
- [ ] Document accepted vs rejected patterns for Phase 3 analysis

## Phase 3 Transition Trigger
Mathematische Bedingung: `accepted_learned / total_learned_attempts >= 0.5` (mindestens 5 von 10 Zyklen akzeptiert)

Bei Trigger:
1. Muster-Extraktion aus akzeptierten learned proposals
2. Neue permanente Regeln P8, P9 etc. generieren
3. Pattern Library aktualisieren
4. Akzeptanzrate monitoring fortsetzen
5. Phase 3: Cross-Domain Metasketart Extraction starten
PYEOF

Attribution

openameropenamer
View sourceSee grades on GitHubMore from openamer →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Caveman

Terse caveman voice: answer first, fluff gone, every technical fact kept. Use for /caveman, "caveman mode", "talk like caveman", "be brief", "less tokens". Stays on until "stop caveman" or "normal mode".

1100021 votes

Hyperplan

Adversarial multi-agent planning skill. Self-orchestrates 5 hostile category members (unspecified-low, unspecified-high, deep, ultrabrain, artistry) via team-mode for ruthless cross-critique debate, distills only the defensible insights, then MANDATORILY hands the distilled insight bundle to the `plan` agent for executable plan formalization. Use when planning needs maximum rigor and surfacing of weak assumptions, blind spots, and over-engineering. Triggers: 'hyperplan', 'hpp', '/hyperplan', ...

698621 votes

Writing Skills

Create and manage Claude Code skills in HASH repository following Anthropic best practices. Use when creating new skills, modifying skill-rules.json, understanding trigger patterns, working with hooks, debugging skill activation, or implementing progressive disclosure. Covers skill structure, YAML frontmatter, trigger types (keywords, intent patterns), UserPromptSubmit hook, and the 500-line rule. Includes validation and debugging with SKILL_DEBUG. Examples include rust-error-stack, cargo-dep...

3931 votes

Mcp Code Execution

Routes multi-tool workflows through MCP servers for large datasets and pipelines. Use when Bash tool overhead is limiting throughput on data-heavy tasks.

3421 votes

catchup

Recovers the conversation and failed tool calls of a previous Codex, Amp, Claude Code, Antigravity, Cline, Copilot CLI, Cursor, DeepSeek Harness, Grok Build, Kimi, OpenCode, Pi Agent, or ZCode session. Use when the user says "catch up", "what did the last session do", "get me up to speed", "I switched agents", asks to recover/summarize a previous session before continuing, or asks to diagnose or report a catchup failure. Do NOT use for the current conversation, git history, or any non-agent log.

741 votes
View all in ai-agents →