simplify-and-harden
Skill2 starsChanged 7 months agoMITView on GitHub
Self-audit after completing code/module changes on Android OpenClaw; run 3 passes simplify, harden, document with scope lock + budget cap + stop hook for refactor.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- pskoett/pskoett-ai-skillstheir own version, first seen Apr 13, 2026
- mick-gsk/drifttheir own version, first seen Apr 4, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- pskoett/pskoett-ai-skills★ 327same name
- mick-gsk/drift★ 14same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository47 other files it gives its agents.
- brainstormingSkill
- claude-code-termux-runbookSkill
- cli-patcherSkill
- code-review-workflowSkill
- commit-commandsSkill
- consulting-analysisSkill
- context7-cleanSkill
- data-analysisSkill
- deep-researchSkill
- edit-tool-compat-guardSkill
- env-managerSkill
- executing-plansSkill
- feature-devSkill
- firecrawlSkill
- frontend-designSkill
- gateway-device-pairingSkill
- githubSkill
- glibc-prebuilt-bundleSkill
- gogSkill
- image-generationSkill
- memory-setupSkill
- module-auditorSkill
- module-scaffoldSkill
- openclaw-config-guardianSkill
- openclaw-ollama-runtime-kbSkill
- plugin-cutover-guardianSkill
- plugin-runtime-guardianSkill
- python-env-managerSkill
- self-improving-agentSkill
- skill-benchSkill
- skill-creatorSkill
- skill-unificationSkill
- skill-vetterSkill
- socratic-groundingSkill
- subagent-orchestrationSkill
- systematic-debuggingSkill
- tailscale-oauth-bridgeSkill
- termux-packagerSkill
- termux-runnerSkill
- test-driven-developmentSkill
- vercel-deploy-claimableSkill
- verification-before-completionSkill
- video-generationSkill
- workspace-cleanupSkill
- writing-plansSkill
- yt-dlp-ingest-firstSkill
- zero-downtime-cutoverSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
22 rules. About 0 are common, 17 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈17
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 30
After finishing a coding task and preparing to report done.
- Very specific: line 31
Only use when there are changes to executable source (.sh, .js, .ts, .py, .go, ...).
- Distinctive: line 36
Scope lock: only files edited in the current task.
- Distinctive: line 38
No silent refactor: every structural refactor must stop and request approval.
- Distinctive: line 39
Security-first: when the budget is tight, prioritize harden patches before simplify cosmetics.
- Distinctive: line 40
No architecture drift: do not add new dependencies/architecture in this pass.
- Distinctive: line 48
remove dead code/unused imports/debug leftovers
- Distinctive: line 62
add input bounds/type checks
- Distinctive: line 73
Add at most 5 short comments for non-obvious decisions.
- Distinctive: line 74
Only write why, do not restate obvious what.
- Very specific: line 81
Avoid eval; if required, sanitize strictly.
- Distinctive: line 82
Do not run destructive commands outside the runtime dir scope.
- Distinctive: line 92
Do not delete user data outside the module namespace.
- Very specific: line 95
Do not log token/secret/PII.
- Distinctive: line 97
Do not hardcode sensitive system paths.
- Very specific: line 110
If the user chooses skip all, continue harden/document and record status skipped_by_user.
- Distinctive: line 113
Must return a summary block:
- Distinctive: line 143
After each skill run:
- Very specific: line 146
If repeated enough times (>=3 times, >=2 tasks, within 30 days) then promote the rule into AGENTS.md/TOOLS.md/SOUL.md.
- Distinctive: line 159
If missing input/permissions: report what is missing and request it clearly.
- Distinctive: line 160
If runtime/tool error: return a short error + likely cause + proposed remediation.
- Distinctive: line 161
If there is policy/safety risk: stop and escalate via approval checkpoint.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Simplify & Harden (OpenClaw Android)
Scope
- In-scope: self-audit after code/module changes through 3 passes simplify, harden, document within the scope of the task just completed.
- Out-of-scope: expanded refactor outside the scope lock or mutation without a stop hook/budget cap.
Indexed Reference Map
- @[SKILL.md#L1-L150] Standard frontmatter (
name,description, compatibility). - @[SKILL.md#L10-L150] Operating rules + 3-pass SOP.
- @[SKILL.md#L70-L150] Android module hardening checklist.
- @[SKILL.md#L118-L150] Output contract + integration with self-improving-agent.
Supporting files
- @[references/openclaw-module-checklist.md#L1-L33] Detailed audit checklist for Android module/service.
- @[references/agent-context-snippets.md#L1-L29] Short snippets to inject into AGENTS.md/CLAUDE.md.
When to use
- After finishing a coding task and preparing to report done.
- Only use when there are changes to executable source (
.sh,.js,.ts,.py,.go, ...). - High priority for changes related to module/service lifecycle on Android.
- Also use immediately for code simplification readability-first, behavior-preserving needs (this part has been absorbed from
code-simplifier).
Mandatory guardrails
- Scope lock: only files edited in the current task.
- Budget cap: total additional changes ≤ 20% of the original diff.
- No silent refactor: every structural refactor must stop and request approval.
- Security-first: when the budget is tight, prioritize harden patches before simplify cosmetics.
- No architecture drift: do not add new dependencies/architecture in this pass.
SOP 3 pass
Pass 1 — Simplify
Goal: clean noise and clarify intent without changing architecture.
Apply automatically (no need to ask):
- remove dead code/unused imports/debug leftovers
- rename ambiguous variables/functions
- flatten deeply nested if branches with early return
- reduce unnecessary visibility
Refactor candidate (must request approval):
- merge/split functions that are structural
- change abstraction boundary
- change the main processing flow
Pass 2 — Harden
Goal: close security gaps + runtime resilience.
Apply automatically:
- add input bounds/type checks
- block basic command/path injection
- remove hardcoded secrets
- standardize error handling without exposing sensitive information
Security refactor (must request approval):
- change auth/authz flow
- change privilege boundary
- change security-sensitive data flow with architectural impact
Pass 3 — Document (micro)
- Add at most 5 short comments for non-obvious decisions.
- Only write why, do not restate obvious what.
Harden Checklist for Android Module
Runtime/script safety
- Validate input from env/args before use.
- Quote shell variables fully (
"$var"), avoid word-splitting. - Avoid
eval; if required, sanitize strictly. - Do not run destructive commands outside the runtime dir scope.
Service lifecycle
start|stop|status|restart|logconsistent.- Handle stale PID correctly.
- Healthcheck failures must fail-fast, not report fake running status.
Install/upgrade safety
- Detect fresh vs upgrade clearly.
- Upgrade must back up/restore config at minimum.
- Do not delete user data outside the module namespace.
Data/security
- Do not log token/secret/PII.
- Config/secret file permissions at minimum necessary.
- Do not hardcode sensitive system paths.
Refactor Stop Hook (mandatory)
Prompt template when there is a refactor:
[simplify-and-harden] Refactor proposal:
- Why: <why the refactor is needed>
- Impact: <file + estimated diff>
- Risk: <main risk>
Action? [approve] [reject] [show diff] [skip all]If the user chooses skip all, continue harden/document and record status skipped_by_user.
Output contract
Must return a summary block:
simplify_and_harden:
version: "2.1.0-merged-code-simplifier"
scope:
files_reviewed: []
original_diff_lines: 0
additional_changes_lines: 0
budget_exceeded: false
simplify:
cosmetic_applied: []
removed_complexity: []
renamed: []
refactor_proposed: []
harden:
patches_applied: []
critical_flagged: []
advisory_flagged: []
document:
comments_added: 0
validation:
behavior_preserving_reasoning: []
summary:
review_followup_required: falseSet review_followup_required: true if there are unresolved flags / skipped refactor / budget_exceeded.
Learning loop integration
After each skill run:
- Standardize findings into
pattern_key(e.g.simplify.dead_code,harden.input_validation). - Send findings to
self-improving-agentto log.learnings/LEARNINGS.md. - If repeated enough times (>=3 times, >=2 tasks, within 30 days) then promote the rule into
AGENTS.md/TOOLS.md/SOUL.md.
Trigger Rules
- Positive: Trigger when the user request matches
simplify-and-hardenper the description: Self-audit after completing code/module changes on Android OpenClaw; run 3 passes simplify, harden, document with scope lock + budget cap + stop hook for refactor. - Negative: Do not trigger for requests outside scope or that do not need the workflow/expertise of this skill.
- Escalation: If there is external action/network write or sensitive operation, add an approval checkpoint before execution.
Output Contract
- Deliverable: results aligned to the goal of
simplify-and-harden; clearly state artifact/path/steps performed (if any). - Validation: report
PASS/FAILstatus together with the main checks run. - Failure mode: when failing, state the root cause + proposed remediation.
Error Handling
- If missing input/permissions: report what is missing and request it clearly.
- If runtime/tool error: return a short error + likely cause + proposed remediation.
- If there is policy/safety risk: stop and escalate via approval checkpoint.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

