repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

update Pi deslop workflow

1c6b96a2e5df920c970c72309820085f167fd6bc

Oliver Jan Krylow <oliver@bugabinga.net> ·

SSH signature · not checked

Browse filesCompare with HEAD

Changed files (4)

pi/agent/prompts/deslop.md

Added
new file mode 100644
1 +---
2 +description: Review code slop; change approved scope only after go
3 +mask: sol
4 +tools: [read, write, edit, bash, grep, find, ls, angel, ask_user_question]
5 +argument-hint: "<file|directory|diff|scope>"
6 +---
8 +# Deslop
10 +Target: `$ARGUMENTS`
12 +Load `desloppy`.
13 +Use its boundary, scope, taxonomy, proof, and verification rules.
15 +## First pass
17 +- Inspect only.
18 + No edits.
19 +- Choose 1–3 highest-impact fixes inside one coherent scope.
20 +- Report:
22 +```markdown
23 +## Findings
24 +- `path:line`
25 + - Slop: exact pattern
26 + - Evidence: concrete symptom
27 + - Fix: smallest deletion or simplification
28 + - Confidence: SAFE | RISKY
29 + - Risk: behavior, API, security, or performance impact
30 +```
32 +Stop.
33 +Continue only when I say `go`.
34 +`ok` is not `go`.
36 +## After go
38 +Apply `desloppy` to approved scope only.
40 +Report:
42 +```markdown
43 +## Status
44 +complete | blocked | failed
46 +## Changes
47 +- `path`: change and reason
49 +## Tests
50 +- baseline and post-change gates
52 +## Risks
53 +- remaining uncertainty
55 +## Remaining
56 +- findings outside approved scope
57 +```

pi/agent/prompts/desloppy.md

Deleted
deleted file mode 100644
1 ----
2 -description: Find ugliest slop in code and fix it
3 -mask: sol
4 -tools: [read, write, edit, bash, grep, find, ls, angel, ask_user_question]
5 -argument-hint: "[file|directory|scope]"
6 ----
8 -# Find ugliest slop in code and fix it
10 -**Target**:
11 -$ARGUMENTS
13 -1. **Scan** - Find the ugliest code (complexity, duplication, poor patterns)
14 -2. **Identify** - What makes it slop?
15 - (nesting, long functions, magic numbers, no types)
16 -3. **Fix** - Rewrite cleanly, with brutal code style
17 -4. **Verify** - Run tests after fixes and create regression tests beforehand, to
18 - make sure to not break old behaviour
20 -Focus on:
22 -- Deep nesting → flatten
23 -- Long functions → extract
24 -- Magic values → name them
25 -- Missing types/docs → add them
26 -- Poor error handling → fix it
27 -- overengineered error handling -> simplify
28 -- overengineering due to "legacy" or "backwards compatibility" -> verify the
29 - need
31 -No mercy.
32 -Make it beautifully brutal.
33 -Pick 1-3 slops with highest impact.
34 -Report minmal and terse first.
35 -Add confidence level (SAFE or RISKY) to slop fixes: Likelyhood of introducing breaking changes.
36 -Wait for approval.

pi/agent/prompts/optimize.md

Modified
13 13 Workflow:
15 -1. **Profile** - Use profiling to find hotspots and other performance problems
16 - Prefer canonical profiling tools for system at hand, otherwise fall back to
17 - tracing and wall time.
18 -2. **Baseline** - Create benchmark
19 -3. **Analyze** - Check code
20 -4. **Optimize** - Write efficient code
21 -5. **Verify** - Re-run benchmark, compare with benchstat
22 -6. **Document** - Comment optimization rationale
15 +1. **Profile** - Find hotspots with the best available canonical profiler for the runtime and OS.
16 + Fall back to tracing or wall time only when appropriate.
17 +2. **Choose measurement** - Match tooling to scope:
18 + - in-process hot path -> microbenchmark
19 + - CLI/process behavior -> end-to-end timing
20 + - CPU hotspot -> CPU profiler
21 + - memory/allocations -> heap profiler
22 + - I/O/network -> tracing
23 +3. **Baseline** - Create a repeatable benchmark before changing code.
24 +4. **Analyze** - Connect measurements to concrete code and explain the bottleneck.
25 +5. **Optimize** - Change only measured bottlenecks.
26 +6. **Verify** - Re-run equivalent baseline/candidate measurements.
27 + Choose an appropriate statistical comparison method.
28 + Report variance, significance, and meaningful regressions.
29 +7. **Document** - Record methodology and rationale for non-obvious optimizations.
24 -To make sure old behaviour did not break, run tests.
31 +Tool choice is part of the work.
32 +Do not prescribe a specific profiler, benchmark framework, or comparison tool.
33 +Prefer canonical tools already available for the runtime, OS, and repository.
34 +Prefer existing repository automation.
36 +If required tooling is missing, stop and tell me exactly which tool is missing and why it is needed.
37 +Ask me to install or enable it.
38 +Continue once I confirm it is available.
39 +Do not silently substitute another tool or change dependencies, system, or build config.
41 +Run tests to make sure old behavior did not break.
25 42 If code to be optimized is not tested, write tests first.
26 -If changes are needed to system tools, dependencies or build system, report to
27 -human.
43 +If changes are needed to system tools, dependencies, or build system, report them to me.

pi/agent/skills/desloppy/SKILL.md

Modified
2 2 name: desloppy
3 -description: "Use when the user asks to desloppy, clean up, simplify, refactor, or review a specific file, directory, diff, or code scope for messy/sloppy code, code smells, technical debt, duplication, complexity, or overengineering."
3 +description: "Use when cleaning or refactoring existing code to remove accidental complexity, duplication, needless indirection, weak types, or overengineering without changing behavior."
6 -# Find ugliest slop in code and fix it
6 +# Desloppy
8 -## Trigger points
8 +Slop works, but costs too much to read, change, or trust.
10 -Use for broad cleanup/refactor reviews of existing code when the user wants the
11 -agent to find high-impact slop.
10 +## Boundary
13 -Do not use for normal feature work, exact bug fixes, formatting-only changes, or
14 -cases where the user already specified the exact change to make.
12 +- Existing code only.
13 +- Preserve observable behavior, public APIs, error meaning, security boundaries, accessibility, and relevant performance behavior.
14 +- No features, unrelated bug fixes, weakened tests, or scope creep.
15 +- Deletion beats addition.
16 -## Instructions
17 +## Scope
18 -1. **Scan** - Find the ugliest code
19 -2. **Identify** - What makes it slop?
20 - (nesting, long functions, magic numbers, no types)
21 -3. **Propose** - Pick 1-3 slops with highest impact
22 -4. **Approve** - Report minimal and terse first; wait for approval
23 -5. **Fix** - Rewrite cleanly, with project code style
24 -6. **Verify** - Run tests after fixes and create regression tests beforehand, to
25 - make sure to not break old behavior
19 +- One scope is one place or one cross-cutting seam.
20 + Never both.
21 +- State scope in one sentence.
22 +- Cannot enumerate callers, tests, and affected boundaries → shrink scope.
27 -Focus on ugly code. Read the relevant reference before proposing fixes:
24 +## Work
29 -- `references/deep-nesting.md` — deep nesting → flatten
30 -- `references/long-functions.md` — long functions → analyze before extracting
31 -- `references/single-use-functions.md` — single use functions → inline
32 -- `references/magic-values.md` — magic values → name them or express relationships
33 -- `references/missing-types-docs.md` — missing types/docs → add them
34 -- `references/poor-error-handling.md` — poor error handling → fix it
35 -- `references/overengineered-error-handling.md` — overengineered error
36 - handling → simplify
37 -- `references/legacy-overengineering.md` — "legacy" or "backwards
38 - compatibility" → verify the need
39 -- `references/complexity.md` — complexity → disentangle dependencies
40 -- `references/duplication.md` — duplication → remove only when changes should
41 - stay together
42 -- `references/poor-patterns.md` — poor patterns → challenge mechanical Clean
43 - Code / OOP ceremony
26 +1. Read scope in full, then callers, tests, public API, and project instructions.
27 +2. Read only references triggered by code:
28 + - `references/deep-nesting.md` → flatten control flow
29 + - `references/long-functions.md` → separate jobs only when separation helps
30 + - `references/single-use-functions.md` → remove single-use indirection
31 + - `references/magic-values.md` → expose hidden meaning or relationships
32 + - `references/missing-types-docs.md` → sharpen types; remove noisy comments
33 + - `references/poor-error-handling.md` → preserve useful error information
34 + - `references/overengineered-error-handling.md` → remove excess machinery
35 + - `references/legacy-overengineering.md` → verify compatibility claims
36 + - `references/complexity.md` → disentangle dependencies
37 + - `references/duplication.md` → unify knowledge that must change together
38 + - `references/poor-patterns.md` → remove unearned ceremony
39 +3. Run smallest project-defined gates covering scope.
40 + Keep pre-existing failures visible.
41 +4. Choose highest-impact behavior-preserving cleanup inside scope.
42 +5. Existing tests do not prove preserved behavior → add focused proof before refactoring.
43 + Never change test expectations merely to make refactor pass.
44 +6. Make smallest surgical change.
45 + Second scope appears → leave it.
46 +7. Run relevant project-defined gates again.
45 -Add confidence level to each proposed slop fix:
48 +## Authority
47 -- **SAFE** - unlikely to introduce breaking changes
48 -- **RISKY** - likely to introduce breaking changes
50 -No mercy.
50 +- Project instructions, source, tests, and project-defined gates outrank this skill.
51 +- `references/*.md` provide local, conditional guidance.
52 +- No other skill required.