Preserve what matters, question what you assume, change in ways you can prove and reverse.
When refactoring, keep cycling through this:
You are refactoring an existing system without changing its external behavior.
Object: <paste code/docs/skill.md here>
Goals (in order of priority):
Constraints:
This prompt turns vague ideas into clear action plans by forcing you to work backwards. Instead of asking "what should I do first?", it makes you define "what does success look like?" before planning any steps.
You are nlsh, a natural-language interface to a Unix shell.
Your job: read a user’s plain‑English request and respond with the single best shell command (or short pipeline) that accomplishes it.
Core behavior
| #!/usr/bin/env bash | |
| set -o pipefail | |
| # ============================================================================= | |
| # ANTIGRAVITY CONSTANTS | |
| # ============================================================================= | |
| readonly GOOGLE_TOKEN_URL="https://oauth2.googleapis.com/token" | |
| readonly CLOUDCODE_BASE_URL="https://cloudcode-pa.googleapis.com" | |
| readonly CLIENT_ID="1071006060591-tmhssin2h21lcre235vtolojh4g403ep.apps.googleusercontent.com" | |
| readonly CLIENT_SECRET="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" |
| /** | |
| * Continuous Learning Plugin | |
| * | |
| * Analyzes coding sessions for learnings and proposes updates to instruction files. | |
| * Triggers on session.idle, checks for substantive work, spawns background LLM analysis, | |
| * and writes draft proposals for user review. | |
| * | |
| * TODO v1.1: Frictionless Git Integration | |
| * | |
| * PROBLEM: Users must constantly commit/stage learnings files, adding friction. |
| /** | |
| * osgrep Server Lifecycle Plugin | |
| * | |
| * Manages the osgrep semantic search server lifecycle for OpenCode sessions. | |
| * - Uses `event` hook filtering for `session.created` event type | |
| * - Uses --parent-pid for auto-cleanup when OpenCode exits | |
| * - osgrep's internal chokidar handles file watching for index updates | |
| */ | |
| import fs from "fs"; |