repositories / smith

smith

There are many coding harnesses - but this one is fast

owned by bugabinga

chore(pi): replace deslop and compress prompts with unattended project skills

b5d54b116b9942a1b5c872e361f828184bf01076

Oliver Jan Krylow <oliver@bugabinga.net> ·

unsigned

Browse filesCompare with HEAD

Changed files (5)

+129 / −175 text lines

Diff layout

.pi/prompts/compress.md

Deleted
deleted file mode 100644

+0 / −80 text lines

1---
2name: compress
3description: Improve code by compressing duplication, bad abstractions, and needless concepts into clearer DRY designs.
4argument-hint: <code area or files to improve>
5---
6
7# Handmade
8
9You are a coding agent that improves code by reducing duplicated logic and
10accidental complexity.
11This is DRY/design compression, not code golf.
13## Mission
15Find places where code can become smaller, clearer, and more powerful by
16removing repetition, merging needless layers, or extracting the right
17abstraction.
18Preserve behavior, tests, and public APIs unless user explicitly approves a
19breaking change.
21Focus on $ARGUMENTS.
23## Targets
25- Near-duplicate functions, modules, data shapes, errors, tests, and command
26 handlers.
27- Boilerplate that should be a helper, trait, enum, macro, table, or data-driven
28 path.
29- Overbroad abstractions that hide simple control flow.
30- Under-abstracted repeated logic that risks drift.
31- Needless wrappers, pass-through methods, dead layers, and repeated
32 conversions.
33- Stringly typed domains that should use enums, newtypes, or typed config.
35## Rust Quality Bar
37- Prefer small composable modules and explicit interfaces.
38- Preserve ownership clarity; do not add `clone`, `Arc`, `Mutex`, or dynamic
39 dispatch unless justified.
40- Keep error handling explicit with `Result` and `?`.
41- Keep public API stable unless migration is planned.
42- Benchmark before performance-motivated compression.
44## Operating Rules
46- Read local patterns before proposing abstractions.
47- Favor one good abstraction over many clever ones.
48- Keep edits behavior-preserving by default.
49- Run focused tests or explain why tests could not run.
50- When risk is high, propose staged migration instead of broad rewrite.
52## Output Contract
54Return Markdown, not JSON.
56Use this shape:
58```markdown
59## Status
60complete | blocked | failed
62## Compression Candidates
63- `path/or/file`
64 - Duplication: what repeats or bloats
65 - Proposal: simpler shared shape
66 - Benefit: less drift, fewer concepts, smaller surface
67 - Risk: behavior/public API/perf risk
69## Edits
70- files changed or proposed
72## Behavior Risk
73low | medium | high
75## Tests
76- tests run or needed
78## Next Steps
79- follow-up cleanup
80```

.pi/prompts/deslop.md

Deleted
deleted file mode 100644

+0 / −89 text lines

1---
2name: deslop
3description: Improve LLM-generated Rust by replacing slop with expert, type-driven, tested code.
4argument-hint: <code area or patch to deslop>
5---
6
7# Sabotnik
8
9You are a coding agent specialized in finding and improving LLM-generated
10Rust/code.
11You turn plausible-looking slop into expert-grade implementation.
13## Mission
15Detect code that looks generated, overconfident, overbroad, under-tested, or
16non-idiomatic.
17Rewrite it toward predictable APIs, type safety, dependability, documented
18failure modes, minimal unsafe, and focused tests.
20Focus on $ARGUMENTS.
22## LLM Slop Patterns
24- Plausible but unverified APIs, hallucinated functions, or bad crate feature
25 choices.
26- Overbroad abstractions, needless traits, generic soup, pass-through layers,
27 and dead code.
28- Duplicated near-identical logic with small naming changes.
29- Stringly typed/domain-weak data instead of enums, newtypes, or validated
30 structs.
31- Excessive `clone`, `Arc`, `Mutex`, boxing, dynamic dispatch, or global state.
32- Async mistakes:
33 lock across `.await`, wrong trait bounds, blocking work in async paths.
34- `unwrap`, `expect`, `panic`, swallowed errors, or vague `anyhow` where domain
35 errors are needed.
36- Missing docs, missing tests, untested error paths, and unverified security
37 assumptions.
38- Unsafe misuse or unsafe without clear safety contract.
39- Insecure input/path/shell/env handling.
41## Expert Rust Rewrite Bar
43- Make invalid states hard or impossible to represent.
44- Use narrow APIs with explicit ownership and lifetimes.
45- Use `Result` plus `?`; document errors, panics, and safety invariants.
46- Prefer simple concrete types until abstraction earns its keep.
47- Remove unused code and needless layers.
48- Add behavior-boundary tests for success and failure paths.
49- Benchmark before optimizing.
51## Operating Rules
53- Verify before rewriting:
54 inspect call sites, tests, and public API surface.
55- Prefer surgical edits over style churn.
56- Preserve behavior unless a bug is proven.
57- Call out breaking changes and migration path.
58- If code may be security-sensitive, slow down and state risk clearly.
60## Output Contract
62Return Markdown, not JSON.
64Use this shape:
66```markdown
67## Status
68complete | blocked | failed
70## Slop Findings
71- `file`
72 - Pattern: LLM slop pattern found
73 - Evidence: specific code symptom
74 - Severity: P0 | P1 | P2 | P3
76## Expert Rewrite
77- `file`
78 - Change: expert Rust improvement
79 - Why: type safety, dependability, clarity, or testability gain
81## Risks
82- behavior, API, security, or migration risks
84## Tests
85- tests run or needed
87## Next Steps
88- remaining cleanup
89```

.pi/settings.json

Deleted
deleted file mode 100644

+0 / −6 text lines

1{
2 "skills": [
3 "/data/data/com.termux/files/home/.pi/agent/skills/luci-ci/SKILL.md",
4 "+/data/data/com.termux/files/home/.pi/agent/skills/luci-ci/SKILL.md"
5 ]
6}No final newline

.pi/skills/compress/SKILL.md

Added
new file mode 100644

+62 / −0 text lines

1---
2name: compress
3description: "Use right after writing new feature code or finishing a refactor in Smith: compress duplication, needless layers, and weak abstractions in the touched code into a smaller DRY design without asking."
4---
5
6# Compress
7
8Make code smaller, clearer, and more powerful by removing repetition and accidental complexity.
9DRY design compression, not code golf.
10Runs unattended: no questions, no approval gates, no stopping between passes.
12## Scope
14- Code touched by the current change (`jj diff --stat`, or the area the user names).
15- Behavior, tests, and public API stay; breaking change → list under Remaining, do not apply.
16- Second scope surfaces → list under Remaining, do not chase.
18## Targets
20- Near-duplicate fns, modules, data shapes, errors, tests, command handlers.
21- Boilerplate better served by helper, enum, table, or data-driven path.
22- Overbroad abstractions hiding simple control flow.
23- Under-abstracted repeated logic that drifts.
24- Needless wrappers, pass-through methods, dead layers, repeated conversions.
25- Stringly typed domains that belong in enums, newtypes, typed config.
27## Bar
29- One good abstraction over many clever ones.
30- Ownership stays clear; no new `clone`, `Arc`, `Mutex`, dynamic dispatch without justification.
31- `Result` + `?` stays explicit.
32- Benchmark before perf-motivated compression.
34## Work
361. Read touched code and local patterns before proposing shared shapes.
372. Run scoped gates; keep pre-existing failures visible.
383. Rank candidates by drift risk removed per line changed; apply low and medium behavior-risk edits, log high.
394. Existing tests do not pin behavior → add focused test before compressing.
405. Run scoped gates again.
42## Report
44```markdown
45## Status
46complete | blocked | failed
48## Candidates
49- `path` · duplication · proposal · benefit · risk
51## Changes
52- `path` · change · why
54## Behavior risk
55low | medium | high
57## Tests
58- gates run, before and after
60## Remaining
61- deferred candidates, breaking proposals
62```

.pi/skills/deslop/SKILL.md

Added
new file mode 100644

+67 / −0 text lines

1---
2name: deslop
3description: "Use right after writing new feature code or finishing a refactor in Smith: find LLM-generated Rust slop in the touched code and rewrite it to expert, type-driven, tested Rust without asking."
4---
5
6# Deslop
7
8Turn plausible-looking generated Rust into expert-grade Rust.
9Runs unattended: no questions, no approval gates, no stopping between passes.
11## Scope
13- Code touched by the current change (`jj diff --stat`, or the area the user names).
14- Existing behavior stays; fix a bug only when proven and say so.
15- Public API stays untouched.
16- Second scope surfaces → list under Remaining, do not chase.
18## Slop patterns
20- Unverified APIs, hallucinated fns, wrong crate features.
21- Overbroad abstractions: one-impl traits, generic soup, pass-through layers, dead code.
22- Near-duplicate logic with renamed variables.
23- Stringly typed domains where enums, newtypes, or validated structs belong.
24- Excess `clone`, `Arc`, `Mutex`, boxing, dynamic dispatch, global state.
25- Async faults: lock held across `.await`, blocking work in async paths, wrong bounds.
26- `unwrap` | `expect` | `panic` | swallowed errors | vague errors where domain errors belong.
27- Missing docs, missing tests, untested error paths, unverified security assumptions.
28- Insecure input, path, shell, env handling.
30## Rewrite bar
32- Invalid states unrepresentable.
33- Narrow APIs, explicit ownership.
34- `Result` + `?`; document errors, panics, safety invariants.
35- Concrete types until abstraction earns its keep.
36- Delete unused code and needless layers.
37- Behavior-boundary tests for success and failure paths.
39## Work
411. Read touched code, call sites, tests, public surface.
422. Run scoped gates; keep pre-existing failures visible.
433. Rank findings by severity; fix P0 and P1 surgically, P2 when cheap, log P3.
444. Missing proof → add focused test before rewriting.
455. Run scoped gates again.
47## Report
49```markdown
50## Status
51complete | blocked | failed
53## Findings
54- `path:line` · pattern · evidence · P0 | P1 | P2 | P3
56## Changes
57- `path` · change · why
59## Tests
60- gates run, before and after
62## Risks
63- behavior, API, security, migration
65## Remaining
66- out-of-scope findings
67```