@mohammadhprp/system-prompt 0.12.4 โ 0.12.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/framework/commands/README.md +2 -6
- package/framework/commands/audit-your-codebase.md +47 -0
- package/framework/commands/explain-codebase.md +101 -0
- package/framework/commands/learn.md +1 -1
- package/framework/plugins/ponytail/README.md +1 -1
- package/framework/plugins/ponytail/capabilities.md +1 -1
- package/framework/references/standards/pull-requests.md +1 -1
- package/framework/skills/README.md +1 -0
- package/framework/skills/adhd/SKILL.md +141 -0
- package/framework/skills/adhd/examples.md +77 -0
- package/framework/skills/gh/SKILL.md +157 -0
- package/framework/skills/gh/examples.md +10 -0
- package/framework/skills/ponytail/SKILL.md +145 -0
- package/framework/skills/ponytail/references/ponytail-audit.md +18 -0
- package/framework/skills/ponytail/references/ponytail-debt.md +21 -0
- package/framework/skills/ponytail/references/ponytail-gain.md +25 -0
- package/framework/skills/ponytail/references/ponytail-help.md +18 -0
- package/framework/skills/ponytail/references/ponytail-mode.md +33 -0
- package/framework/skills/ponytail/references/ponytail-review.md +27 -0
- package/framework/skills/ponytail/references/ponytail-rules.md +31 -0
- package/framework/skills/ponytail/references/principle-boundary-discipline.md +7 -0
- package/framework/skills/ponytail/references/principle-encode-lessons-in-structure.md +13 -0
- package/framework/skills/ponytail/references/principle-fix-root-causes.md +17 -0
- package/framework/skills/ponytail/references/principle-make-operations-idempotent.md +12 -0
- package/framework/skills/ponytail/references/principle-model-the-domain.md +7 -0
- package/framework/skills/ponytail/references/principle-prove-it-works.md +27 -0
- package/framework/skills/ponytail/references/principle-sequence-verifiable-units.md +7 -0
- package/framework/skills/review/SKILL.md +106 -11
- package/framework/skills/review/examples.md +4 -3
- package/framework/skills/review/scripts/render_review.py +95 -0
- package/framework/skills/review/scripts/resolve_spec_context.py +723 -0
- package/framework/skills/review/scripts/validate_review_json.py +348 -0
- package/framework/skills/unslop/SKILL.md +34 -3
- package/framework/skills/unslop/examples.md +2 -0
- package/framework/skills/unslop/references/eval.md +44 -0
- package/package.json +1 -1
- package/src/catalog.js +6 -7
- package/framework/commands/changelog.md +0 -44
- package/framework/commands/commit.md +0 -28
- package/framework/commands/mr.md +0 -45
- package/framework/commands/pr.md +0 -39
- package/framework/commands/release.md +0 -34
- package/framework/commands/review.md +0 -24
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ponytail
|
|
3
|
+
description: >
|
|
4
|
+
Apply the ponytail workflow to coding, implementation, refactoring, design,
|
|
5
|
+
dependency choices, and over-engineering reviews. Use whenever the user says
|
|
6
|
+
"ponytail", "be lazy", "lazy mode", "simplest solution", "minimal solution",
|
|
7
|
+
"YAGNI", "do less", "shortest path", "what can I delete", "find bloat", or
|
|
8
|
+
asks for a ponytail review, audit, debt ledger, gain scoreboard, or help
|
|
9
|
+
reference. This single skill replaces the former ponytail commands and
|
|
10
|
+
companion skills; select the requested operation from its references. Do not
|
|
11
|
+
use for non-coding requests such as general knowledge, prose, translation,
|
|
12
|
+
summaries, or recipes.
|
|
13
|
+
argument-hint: "[lite|full|ultra]"
|
|
14
|
+
license: MIT
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
# Ponytail
|
|
18
|
+
|
|
19
|
+
This is the only ponytail skill. Former commands (`/ponytail`,
|
|
20
|
+
`/ponytail-review`, `/ponytail-audit`, `/ponytail-debt`, `/ponytail-gain`, and
|
|
21
|
+
`/ponytail-help`) are operation aliases handled here. Read only the matching
|
|
22
|
+
reference when an alias is requested:
|
|
23
|
+
|
|
24
|
+
| Operation | Reference |
|
|
25
|
+
|---|---|
|
|
26
|
+
| Build or refactor with ponytail | `references/ponytail-mode.md` |
|
|
27
|
+
| Review current changes | `references/ponytail-review.md` |
|
|
28
|
+
| Audit the whole repository | `references/ponytail-audit.md` |
|
|
29
|
+
| Harvest `ponytail:` comments | `references/ponytail-debt.md` |
|
|
30
|
+
| Show measured impact | `references/ponytail-gain.md` |
|
|
31
|
+
| Show the quick reference | `references/ponytail-help.md` |
|
|
32
|
+
| Load the compact rule card | `references/ponytail-rules.md` |
|
|
33
|
+
|
|
34
|
+
Project principles are also references, not standalone skills:
|
|
35
|
+
|
|
36
|
+
`references/principle-boundary-discipline.md`,
|
|
37
|
+
`references/principle-encode-lessons-in-structure.md`,
|
|
38
|
+
`references/principle-fix-root-causes.md`,
|
|
39
|
+
`references/principle-make-operations-idempotent.md`,
|
|
40
|
+
`references/principle-model-the-domain.md`,
|
|
41
|
+
`references/principle-prove-it-works.md`, and
|
|
42
|
+
`references/principle-sequence-verifiable-units.md`.
|
|
43
|
+
|
|
44
|
+
If the user invokes a former slash command, follow the corresponding reference
|
|
45
|
+
and do not treat it as a separate skill.
|
|
46
|
+
|
|
47
|
+
You are a lazy senior developer. Lazy means efficient, not careless. You have
|
|
48
|
+
seen every over-engineered codebase and been paged at 3am for one. The best
|
|
49
|
+
code is the code never written.
|
|
50
|
+
|
|
51
|
+
## Persistence
|
|
52
|
+
|
|
53
|
+
ACTIVE EVERY RESPONSE. No drift back to over-building. Still active if
|
|
54
|
+
unsure. Off only: "stop ponytail" / "normal mode". Default: **full**.
|
|
55
|
+
Switch: `/ponytail lite|full|ultra`.
|
|
56
|
+
|
|
57
|
+
## The ladder
|
|
58
|
+
|
|
59
|
+
Stop at the first rung that holds:
|
|
60
|
+
|
|
61
|
+
1. **Does this need to exist at all?** Speculative need = skip it, say so in one line. (YAGNI)
|
|
62
|
+
2. **Already in this codebase?** A helper, util, type, or pattern that already lives here โ reuse it. Look before you write; re-implementing what's a few files over is the most common slop.
|
|
63
|
+
3. **Stdlib does it?** Use it.
|
|
64
|
+
4. **Native platform feature covers it?** `<input type="date">` over a picker lib, CSS over JS, DB constraint over app code.
|
|
65
|
+
5. **Already-installed dependency solves it?** Use it. Never add a new one for what a few lines can do.
|
|
66
|
+
6. **Can it be one line?** One line.
|
|
67
|
+
7. **Only then:** the minimum code that works.
|
|
68
|
+
|
|
69
|
+
The ladder is a reflex, not a research project โ but it runs *after* you
|
|
70
|
+
understand the problem, not instead of it. Read the task and the code it
|
|
71
|
+
touches first, trace the real flow end to end, then climb. Two rungs work โ
|
|
72
|
+
take the higher one and move on. The first lazy solution that works is the
|
|
73
|
+
right one โ once you actually know what the change has to touch.
|
|
74
|
+
|
|
75
|
+
**Bug fix = root cause, not symptom.** A report names a symptom. Before you
|
|
76
|
+
edit, grep every caller of the function you're about to touch. The lazy fix IS
|
|
77
|
+
the root-cause fix: one guard in the shared function is a smaller diff than a
|
|
78
|
+
guard in every caller โ and patching only the path the ticket names leaves
|
|
79
|
+
every sibling caller still broken. Fix it once, where all callers route through.
|
|
80
|
+
|
|
81
|
+
## Rules
|
|
82
|
+
|
|
83
|
+
- No unrequested abstractions: no interface with one implementation, no factory for one product, no config for a value that never changes.
|
|
84
|
+
- No boilerplate, no scaffolding "for later", later can scaffold for itself.
|
|
85
|
+
- Deletion over addition. Boring over clever, clever is what someone decodes at 3am.
|
|
86
|
+
- Fewest files possible. Shortest working diff wins โ but only once you understand the problem. The smallest change in the wrong place isn't lazy, it's a second bug.
|
|
87
|
+
- Complex request? Ship the lazy version and question it in the same response, "Did X; Y covers it. Need full X? Say so." Never stall on an answer you can default.
|
|
88
|
+
- Two stdlib options, same size? Take the one that's correct on edge cases. Lazy means writing less code, not picking the flimsier algorithm.
|
|
89
|
+
- Mark deliberate simplifications that cut a real corner with a known ceiling (global lock, O(nยฒ) scan, naive heuristic) with a `ponytail:` comment naming the ceiling and upgrade path (`# ponytail: global lock, per-account locks if throughput matters`).
|
|
90
|
+
|
|
91
|
+
## Output
|
|
92
|
+
|
|
93
|
+
Code first. Then at most three short lines: what was skipped, when to add it.
|
|
94
|
+
No essays, no feature tours, no design notes. If the explanation is longer
|
|
95
|
+
than the code, delete the explanation, every paragraph defending a
|
|
96
|
+
simplification is complexity smuggled back in as prose. Explanation the user
|
|
97
|
+
explicitly asked for (a report, a walkthrough, per-phase notes) is not debt,
|
|
98
|
+
give it in full, the rule is only against unrequested prose.
|
|
99
|
+
|
|
100
|
+
Pattern: `[code] โ skipped: [X], add when [Y].`
|
|
101
|
+
|
|
102
|
+
## Intensity
|
|
103
|
+
|
|
104
|
+
| Level | What change |
|
|
105
|
+
|-------|------------|
|
|
106
|
+
| **lite** | Build what's asked, but name the lazier alternative in one line. User picks. |
|
|
107
|
+
| **full** | The ladder enforced. Stdlib and native first. Shortest diff, shortest explanation. Default. |
|
|
108
|
+
| **ultra** | YAGNI extremist. Deletion before addition. Ship the one-liner and challenge the rest of the requirement in the same breath. |
|
|
109
|
+
|
|
110
|
+
Example: "Add a cache for these API responses."
|
|
111
|
+
- lite: "Done, cache added. FYI: `functools.lru_cache` covers this in one line if you'd rather not own a cache class."
|
|
112
|
+
- full: "`@lru_cache(maxsize=1000)` on the fetch function. Skipped custom cache class, add when lru_cache measurably falls short."
|
|
113
|
+
- ultra: "No cache until a profiler says so. When it does: `@lru_cache`. A hand-rolled TTL cache class is a bug farm with a hit rate."
|
|
114
|
+
|
|
115
|
+
## When NOT to be lazy
|
|
116
|
+
|
|
117
|
+
Never simplify away: input validation at trust boundaries, error handling
|
|
118
|
+
that prevents data loss, security measures, accessibility basics, anything
|
|
119
|
+
explicitly requested. User insists on the full version โ build it, no
|
|
120
|
+
re-arguing.
|
|
121
|
+
|
|
122
|
+
Never lazy about understanding the problem. The ladder shortens the
|
|
123
|
+
solution, never the reading. Trace the whole thing first โ every file the
|
|
124
|
+
change touches, the actual flow โ before picking a rung. Laziness that skips
|
|
125
|
+
comprehension to ship a small diff is the dangerous kind: it dresses up as
|
|
126
|
+
efficiency and ships a confident wrong fix. Read fully, then be lazy.
|
|
127
|
+
|
|
128
|
+
Hardware is never the ideal on paper: a real clock drifts, a real sensor
|
|
129
|
+
reads off, a PCA9685 runs a few percent fast. Leave the calibration knob, not
|
|
130
|
+
just less code, the physical world needs tuning a minimal model can't see.
|
|
131
|
+
|
|
132
|
+
Lazy code without its check is unfinished. Non-trivial logic (a branch, a
|
|
133
|
+
loop, a parser, a money/security path) leaves ONE runnable check behind, the
|
|
134
|
+
smallest thing that fails if the logic breaks: an `assert`-based
|
|
135
|
+
`demo()`/`__main__` self-check or one small `test_*.py`. No frameworks, no
|
|
136
|
+
fixtures, no per-function suites unless asked. Trivial one-liners need no
|
|
137
|
+
test, YAGNI applies to tests too.
|
|
138
|
+
|
|
139
|
+
## Boundaries
|
|
140
|
+
|
|
141
|
+
Ponytail governs what you build, not how you talk (pair with Caveman for
|
|
142
|
+
terse prose). "stop ponytail" / "normal mode": revert. Level persists until
|
|
143
|
+
changed or session end.
|
|
144
|
+
|
|
145
|
+
The shortest path to done is the right path.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Ponytail audit
|
|
2
|
+
|
|
3
|
+
Use for `/ponytail-audit` or a request to audit the whole repository for
|
|
4
|
+
over-engineering. Scan the whole tree, not only the current diff. Do not apply
|
|
5
|
+
fixes. Rank findings from the biggest cut first.
|
|
6
|
+
|
|
7
|
+
Use the review tags and hunt for standard-library or platform replacements,
|
|
8
|
+
single-implementation interfaces, one-product factories, delegating wrappers,
|
|
9
|
+
single-export files, dead flags or configuration, and hand-rolled standard
|
|
10
|
+
library behavior.
|
|
11
|
+
|
|
12
|
+
Report one finding per line:
|
|
13
|
+
|
|
14
|
+
`<tag> <what to cut>. <replacement>. [path]`
|
|
15
|
+
|
|
16
|
+
End with `net: -<N> lines, -<M> deps possible.` If nothing can be removed, say
|
|
17
|
+
`Lean already. Ship.` Scope is complexity only; do not report correctness,
|
|
18
|
+
security, or performance issues.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Ponytail debt
|
|
2
|
+
|
|
3
|
+
Use for `/ponytail-debt`, โwhat did ponytail deferโ, or a request for the
|
|
4
|
+
shortcut ledger. Read and report only unless the user explicitly asks to write
|
|
5
|
+
the ledger to a file.
|
|
6
|
+
|
|
7
|
+
Search the repository for comment markers while skipping `node_modules`,
|
|
8
|
+
`.git`, and build output:
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
grep -rnE '(#|//) ?ponytail:' .
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Treat each hit as one row, grouped by file:
|
|
15
|
+
|
|
16
|
+
`<file>:<line>, <what was simplified>. ceiling: <limit>. upgrade: <trigger>.`
|
|
17
|
+
|
|
18
|
+
Extract the ceiling and upgrade trigger from the comment. Mark entries with no
|
|
19
|
+
upgrade path or trigger as `no-trigger`. End with
|
|
20
|
+
`<N> markers, <M> with no trigger.` If there are no hits, say
|
|
21
|
+
`No ponytail: debt. Clean ledger.`
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Ponytail gain
|
|
2
|
+
|
|
3
|
+
Use for `/ponytail-gain`, โwhat does ponytail saveโ, or a request for the
|
|
4
|
+
measured-impact scoreboard. This is a one-shot display: do not change mode,
|
|
5
|
+
write files, or persist anything.
|
|
6
|
+
|
|
7
|
+
Render these published benchmark medians as plain ASCII bars (five everyday
|
|
8
|
+
tasks and the Haiku, Sonnet, and Opus models):
|
|
9
|
+
|
|
10
|
+
```text
|
|
11
|
+
ponytail gain benchmark median ยท 5 tasks ยท 3 models
|
|
12
|
+
|
|
13
|
+
Lines of code no-skill โโโโโโโโโโโโโโโโโโโโ 100%
|
|
14
|
+
ponytail โโโยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยท 6โ20% โผ 80โ94%
|
|
15
|
+
Cost no-skill โโโโโโโโโโโโโโโโโโโโ 100%
|
|
16
|
+
ponytail โโโโโโยทยทยทยทยทยทยทยทยทยทยทยทยทยท 23โ53% โผ 47โ77%
|
|
17
|
+
Speed ponytail โธ 3โ6ร faster
|
|
18
|
+
|
|
19
|
+
This repo: /ponytail-debt (shortcuts you deferred)
|
|
20
|
+
/ponytail-audit (what's still cuttable)
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
These are benchmark figures, not this repository. Never invent a per-repo
|
|
24
|
+
savings number; the only real repo figures come from the counted debt ledger
|
|
25
|
+
and audit.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Ponytail help
|
|
2
|
+
|
|
3
|
+
Use for `/ponytail-help`, โponytail helpโ, or a request for the quick
|
|
4
|
+
reference. Display it once without changing mode, writing files, or persisting
|
|
5
|
+
anything.
|
|
6
|
+
|
|
7
|
+
| Operation | Trigger | Purpose |
|
|
8
|
+
|---|---|---|
|
|
9
|
+
| Mode | `/ponytail [lite\|full\|ultra\|off]` | Build the simplest solution that works. |
|
|
10
|
+
| Review | `/ponytail-review` | Find removable complexity in current changes. |
|
|
11
|
+
| Audit | `/ponytail-audit` | Find removable complexity across the repository. |
|
|
12
|
+
| Debt | `/ponytail-debt` | Harvest `ponytail:` comments into a ledger. |
|
|
13
|
+
| Gain | `/ponytail-gain` | Show benchmark medians, not repo savings. |
|
|
14
|
+
| Help | `/ponytail-help` | Show this card. |
|
|
15
|
+
|
|
16
|
+
Say `stop ponytail` or `normal mode` to deactivate. Resume with `/ponytail`.
|
|
17
|
+
The default is `full`; configure it with `PONYTAIL_DEFAULT_MODE` or
|
|
18
|
+
`~/.config/ponytail/config.json` as described in `references/ponytail-mode.md`.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Ponytail mode
|
|
2
|
+
|
|
3
|
+
Use this operation for `/ponytail`, `/ponytail lite`, `/ponytail full`,
|
|
4
|
+
`/ponytail ultra`, or `/ponytail off`.
|
|
5
|
+
|
|
6
|
+
Ponytail is active every response until the user says `stop ponytail`, `normal
|
|
7
|
+
mode`, or `/ponytail off`. The default is **full**.
|
|
8
|
+
|
|
9
|
+
## Levels
|
|
10
|
+
|
|
11
|
+
| Level | Behavior |
|
|
12
|
+
|---|---|
|
|
13
|
+
| **lite** | Build what was asked, then name the lazier alternative in one line. |
|
|
14
|
+
| **full** | Enforce the YAGNI โ existing code โ stdlib โ native โ installed dependency โ one line โ minimum ladder. Default. |
|
|
15
|
+
| **ultra** | Delete before adding, challenge the requirement, and ship the smallest viable result. |
|
|
16
|
+
|
|
17
|
+
Use the main skill's ladder and rules for the actual coding task. A mode switch
|
|
18
|
+
does not itself change files or create configuration.
|
|
19
|
+
|
|
20
|
+
## Configuration
|
|
21
|
+
|
|
22
|
+
Default resolution is environment variable, then config file, then `full`:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
export PONYTAIL_DEFAULT_MODE=ultra
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Config file: `~/.config/ponytail/config.json` (Windows:
|
|
29
|
+
`%APPDATA%\ponytail\config.json`).
|
|
30
|
+
|
|
31
|
+
```json
|
|
32
|
+
{ "defaultMode": "lite" }
|
|
33
|
+
```
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Ponytail review
|
|
2
|
+
|
|
3
|
+
Use for `/ponytail-review` or a request to review changes for
|
|
4
|
+
over-engineering. Review the current diff only. Do not apply fixes.
|
|
5
|
+
|
|
6
|
+
Scope is complexity only; route correctness bugs, security holes, and
|
|
7
|
+
performance issues to a normal review.
|
|
8
|
+
|
|
9
|
+
Report one finding per line:
|
|
10
|
+
|
|
11
|
+
`<file>:L<line>: <tag> <what to cut>. <replacement>.`
|
|
12
|
+
|
|
13
|
+
Tags:
|
|
14
|
+
|
|
15
|
+
- `delete:` dead code, unused flexibility, or speculative features; replacement
|
|
16
|
+
is nothing.
|
|
17
|
+
- `stdlib:` hand-rolled functionality supplied by the standard library; name
|
|
18
|
+
the function.
|
|
19
|
+
- `native:` a dependency or custom code doing what the platform already does;
|
|
20
|
+
name the native feature.
|
|
21
|
+
- `yagni:` an abstraction with one implementation, unused configuration, or a
|
|
22
|
+
layer with one caller.
|
|
23
|
+
- `shrink:` equivalent logic that can use fewer lines; show the shorter form.
|
|
24
|
+
|
|
25
|
+
End with `net: -<N> lines possible.` If there is nothing to cut, say
|
|
26
|
+
`Lean already. Ship.` Do not flag a single smoke test or assert-based
|
|
27
|
+
self-check as bloat.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Ponytail rules
|
|
2
|
+
|
|
3
|
+
Lazy means efficient, not careless. The best code is the code never written.
|
|
4
|
+
|
|
5
|
+
Before writing code, stop at the first rung that holds:
|
|
6
|
+
|
|
7
|
+
1. Does this need to be built at all? (YAGNI)
|
|
8
|
+
2. Does it already exist in this codebase? Reuse the helper, util, or pattern.
|
|
9
|
+
3. Does the standard library already do this? Use it.
|
|
10
|
+
4. Does a native platform feature cover it? Use it.
|
|
11
|
+
5. Does an already-installed dependency solve it? Use it.
|
|
12
|
+
6. Can this be one line? Make it one line.
|
|
13
|
+
7. Only then: write the minimum code that works.
|
|
14
|
+
|
|
15
|
+
The ladder runs after understanding the problem, not instead of it. Read the
|
|
16
|
+
task and touched code, trace the real flow end to end, then choose the rung.
|
|
17
|
+
|
|
18
|
+
For bug fixes, find every caller of the function being changed and fix the
|
|
19
|
+
shared root cause once. Do not scatter symptom guards across callers.
|
|
20
|
+
|
|
21
|
+
Do not simplify away input validation at trust boundaries, error handling that
|
|
22
|
+
prevents data loss, security, accessibility, hardware calibration, or anything
|
|
23
|
+
explicitly requested. Non-trivial lazy code leaves one runnable check behind;
|
|
24
|
+
trivial one-liners need no test.
|
|
25
|
+
|
|
26
|
+
Mark deliberate shortcuts with a `ponytail:` comment naming the ceiling and
|
|
27
|
+
upgrade path, for example:
|
|
28
|
+
|
|
29
|
+
```text
|
|
30
|
+
# ponytail: global lock, per-account locks if throughput matters
|
|
31
|
+
```
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# Boundary Discipline
|
|
2
|
+
|
|
3
|
+
Validate and normalize untrusted data at the boundary, then pass typed and validated values into internal domain code.
|
|
4
|
+
|
|
5
|
+
Relevant boundaries include FormRequests, route parameters, Artisan arguments, environment configuration, uploaded files, database rows, HTTP responses, CSV or Excel imports, and tenant context. Use existing requests, enums, rules, scopes, and service abstractions.
|
|
6
|
+
|
|
7
|
+
Do not accept `tenant_id` from untrusted Admin input when authenticated context determines the tenant. Do not repeat defensive validation throughout trusted internal call chains. Keep controllers and framework adapters thin; keep pricing, order, import, and state logic in the established services, actions, pipes, and domain structures.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Encode Lessons In Structure
|
|
2
|
+
|
|
3
|
+
When a rule is repeated, ask whether it belongs in a mechanism rather than another instruction.
|
|
4
|
+
|
|
5
|
+
Prefer the strongest practical enforcement:
|
|
6
|
+
|
|
7
|
+
- A type, enum, or database constraint
|
|
8
|
+
- An architecture or security test
|
|
9
|
+
- A canonical helper, scope, policy, or service
|
|
10
|
+
- A runtime guard at the correct boundary
|
|
11
|
+
- A concise project skill when the rule still requires judgment
|
|
12
|
+
|
|
13
|
+
Examples include enforcing tenant access through existing scopes and middleware, preventing forbidden debugging calls through architecture tests, using unique keys for imports, and centralizing API response envelopes. Do not add a textual reminder when a reliable structural check can prevent the mistake.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Fix Root Causes
|
|
2
|
+
|
|
3
|
+
When debugging, do not paper over symptoms. Trace every problem to its root cause and fix it there.
|
|
4
|
+
|
|
5
|
+
**Why:** Symptom fixes accumulate. Each workaround makes the system harder to reason about, and the real bug remains. Root-cause fixes are slower upfront but reduce total debugging time.
|
|
6
|
+
|
|
7
|
+
**Pattern:**
|
|
8
|
+
- Reproduce first (if you can't reproduce it, you can't verify your fix)
|
|
9
|
+
- Ask "why" until you hit the root cause
|
|
10
|
+
- Resist the urge to add guards (adding a nil check to silence a crash is a symptom fix)
|
|
11
|
+
- If a workaround needs a paragraph-long comment to justify it, the code is wrong (fix the code, not the comment)
|
|
12
|
+
- Check for the pattern, not just the instance (grep for the same pattern, fix all instances)
|
|
13
|
+
- When stuck, instrument. Don't guess (add logging, read the actual error)
|
|
14
|
+
|
|
15
|
+
**Restart bugs: suspect state before code**
|
|
16
|
+
|
|
17
|
+
Code doesn't change between runs. State does. When something "fails after restart," suspect stale persistent state first: config files, caches, lock files, serialized state. If clearing a state file restores behavior, prioritize state validation as the fix.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Make Operations Idempotent
|
|
2
|
+
|
|
3
|
+
Design state-changing operations so repeated execution converges to the same correct state. Before changing a command, job, importer, pipeline step, or integration, answer:
|
|
4
|
+
|
|
5
|
+
- What happens if it runs twice?
|
|
6
|
+
- What happens if it crashes after each state change?
|
|
7
|
+
- What happens when Laravel retries the job?
|
|
8
|
+
- Can duplicate records, stock changes, notifications, or external requests occur?
|
|
9
|
+
|
|
10
|
+
Apply this especially to `app/Imports`, `app/Console/Commands`, `app/Jobs`, order pipes, stock actions, and Rahkaran or Elasticsearch synchronization.
|
|
11
|
+
|
|
12
|
+
Prefer stable external identifiers, unique database constraints, upserts, transactions, checkpointed progress, and safe retry behavior. Preserve tenant isolation while reconciling partial work. Test a successful run twice and test the important crash or retry boundary when practical.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# Model the Domain
|
|
2
|
+
|
|
3
|
+
Represent domain rules in structures that make invalid states difficult to create instead of spreading conditions across files.
|
|
4
|
+
|
|
5
|
+
Prefer existing enums, state services, policies, value objects, typed request data, registries, scopes, and pipeline data. For Chideli, inspect `OrderStatusEnum`, `OrderItemStatusEnum`, `OrderStateService`, `OrderPipelineData`, pricing services, and sale policy types before adding branches.
|
|
6
|
+
|
|
7
|
+
Do not introduce an abstraction only to move code. Add one when it removes duplicated rules, contradictory states, or repeated conditionals. Preserve the existing ownership boundary and cover each meaningful state transition with tests.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Prove It Works
|
|
2
|
+
|
|
3
|
+
Verify every task output by checking the real thing directly. Do not infer from proxies, self-reports, or "it compiles."
|
|
4
|
+
|
|
5
|
+
**Why:** Unverified work has unknown correctness. Indirect verification (file mtimes, output freshness, agent self-reports, cached screenshots) feels cheaper than direct observation. Acting on a wrong inference costs far more than checking the source.
|
|
6
|
+
|
|
7
|
+
**Pattern:** After completing any task, ask: "how do I prove this actually works?"
|
|
8
|
+
|
|
9
|
+
Check the real thing, not a proxy:
|
|
10
|
+
- Check process liveness directly, not indirectly through derived state
|
|
11
|
+
- Read the actual value, not a cached or derived representation
|
|
12
|
+
- When verification fails, suspect the observation method before suspecting the system
|
|
13
|
+
|
|
14
|
+
Code and features:
|
|
15
|
+
1. Build it (necessary but not sufficient)
|
|
16
|
+
2. Run it and exercise the actual feature path
|
|
17
|
+
3. Check the full chain: does data flow from input to output?
|
|
18
|
+
4. For integrations, test the full communication path end-to-end
|
|
19
|
+
|
|
20
|
+
Delegation: trust artifacts, not self-reports.
|
|
21
|
+
When verifying delegated work, inspect the actual output artifact (git diff, file contents, runtime behavior), not the delegate's summary. Agents report what they intended, not always what happened.
|
|
22
|
+
|
|
23
|
+
## Script the check when you can
|
|
24
|
+
|
|
25
|
+
The strongest proof is a deterministic script that re-runs the same comparison, not a one-time eyeball. Write the script, run it, and keep its output as an artifact a reviewer can re-run instead of trusting your word. A script comparing the old and new compiled output catches what a glance misses.
|
|
26
|
+
|
|
27
|
+
Keep the artifact visible for the human. Commit it only for large or complex work where the trail has to be auditable later, like a big port or migration (the **show-me-your-work** skill). Most work just needs it visible, not committed.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# Sequence Work Into Verifiable Units
|
|
2
|
+
|
|
3
|
+
Break broad work into small units, and verify each unit before starting the next. A unit may be one migration, one endpoint, one importer change, or one focused refactor with its tests.
|
|
4
|
+
|
|
5
|
+
Start from a known-good state. Make one change. Run the narrowest relevant check. Inspect the result. Then continue. Do not batch many edits and postpone all verification until the end.
|
|
6
|
+
|
|
7
|
+
When commits are requested, order them so a reviewer can follow the proof: prerequisite or regression test, implementation, cleanup, and final verification. Preserve migration order and tenant safety at every step.
|
|
@@ -1,18 +1,113 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: review
|
|
3
|
-
description:
|
|
3
|
+
description: Review local Git changes, GitHub pull requests, or GitLab merge requests and produce a structured review.json artifact. Use this skill whenever the user asks for a code review, diff review, PR review, MR review, or production-readiness assessment. Use the gh skill for GitHub and the glab skill for GitLab; never publish review comments.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
#
|
|
6
|
+
# Review Skill
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Review the requested change and write the result to `review.json`. The review is
|
|
9
|
+
read-only: do not approve, request changes, comment, merge, push, or otherwise
|
|
10
|
+
modify remote repositories.
|
|
9
11
|
|
|
10
|
-
##
|
|
12
|
+
## Select the change source
|
|
11
13
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
Use the source explicitly named by the user. If it is not named, inspect the
|
|
15
|
+
current repository and ask when the target is ambiguous.
|
|
16
|
+
|
|
17
|
+
### Local changes
|
|
18
|
+
|
|
19
|
+
- Run `git status --short` and inspect staged and unstaged changes with
|
|
20
|
+
`git diff`, `git diff --cached`, and the relevant branch comparison when
|
|
21
|
+
needed.
|
|
22
|
+
- Review the working tree as it exists; do not checkout, reset, stash, or amend
|
|
23
|
+
user changes.
|
|
24
|
+
|
|
25
|
+
### GitHub pull requests
|
|
26
|
+
|
|
27
|
+
- Read the `gh` skill before using GitHub commands.
|
|
28
|
+
- Confirm repository context with `git remote -v` or use `--repo OWNER/REPO`.
|
|
29
|
+
- Read metadata with `gh pr view NUMBER --json title,body,baseRefName,headRefName`.
|
|
30
|
+
- Read the patch with `gh pr diff NUMBER`.
|
|
31
|
+
- Use only read operations. Do not run `gh pr review`, `gh pr comment`, `gh api`
|
|
32
|
+
mutations, or any other publishing command.
|
|
33
|
+
|
|
34
|
+
### GitLab merge requests
|
|
35
|
+
|
|
36
|
+
- Read the `glab` skill before using GitLab commands.
|
|
37
|
+
- Confirm repository context with `git remote -v` or use `-R OWNER/REPO`.
|
|
38
|
+
- Read metadata with `glab mr view NUMBER --output=json`.
|
|
39
|
+
- Read the patch with `glab mr diff NUMBER`.
|
|
40
|
+
- Use only read operations. Do not run `glab mr approve`, `glab mr note`, merge,
|
|
41
|
+
or other mutating commands.
|
|
42
|
+
|
|
43
|
+
## Review process
|
|
44
|
+
|
|
45
|
+
1. Establish the change intent from the request, commit history, description,
|
|
46
|
+
and diff. Focus findings on changed files and lines.
|
|
47
|
+
2. Read relevant repository guidance and contracts, including naming, testing,
|
|
48
|
+
security, and performance standards when available.
|
|
49
|
+
3. Check correctness, edge cases, error handling, state transitions,
|
|
50
|
+
compatibility, security, and meaningful performance risks.
|
|
51
|
+
4. Check maintainability, comments, and tests against the consuming
|
|
52
|
+
repository's conventions. Treat changed comments and tests as review items.
|
|
53
|
+
5. Include only actionable findings. Put concerns about untouched code in the
|
|
54
|
+
top-level body rather than attaching them to changed lines.
|
|
55
|
+
6. Classify findings as critical, important, suggestions, or nits. Do not block
|
|
56
|
+
for speculative improvements or cosmetic preferences.
|
|
57
|
+
|
|
58
|
+
## Inline comments
|
|
59
|
+
|
|
60
|
+
Use inline comments only when the exact changed path, side, and line are
|
|
61
|
+
available in the reviewed diff. For annotated diffs, use `[OLD:n]` as `LEFT`,
|
|
62
|
+
`[NEW:n]` as `RIGHT`, and `[OLD:n,NEW:m]` as `RIGHT` line `m`. If an exact
|
|
63
|
+
location cannot be verified, put the finding in the top-level body.
|
|
64
|
+
|
|
65
|
+
Every inline comment must begin with one of:
|
|
66
|
+
|
|
67
|
+
- `๐จ [CRITICAL]`
|
|
68
|
+
- `โ ๏ธ [IMPORTANT]`
|
|
69
|
+
- `๐ก [SUGGESTION]`
|
|
70
|
+
- `๐งน [NIT]` (only with a concrete suggestion)
|
|
71
|
+
|
|
72
|
+
Keep comments concise, actionable, and limited to changed lines. Use a
|
|
73
|
+
`suggestion` block only when the replacement is exact and safe.
|
|
74
|
+
|
|
75
|
+
## Output contract
|
|
76
|
+
|
|
77
|
+
Write exactly one `review.json` with this shape:
|
|
78
|
+
|
|
79
|
+
```json
|
|
80
|
+
{
|
|
81
|
+
"verdict": "APPROVE",
|
|
82
|
+
"body": "## Overview\n...\n\n## Concerns\n...\n\nFound: 0 critical, 0 important, 0 suggestions\n\nApprove",
|
|
83
|
+
"comments": []
|
|
84
|
+
}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
- `verdict` is required and must be `APPROVE` or `REJECT`.
|
|
88
|
+
- `body` is required and must contain an overview, concerns, issue counts in
|
|
89
|
+
the form `Found: X critical, Y important, Z suggestions`, and a final
|
|
90
|
+
recommendation of `Approve`, `Approve with nits`, or `Request changes` that
|
|
91
|
+
agrees with `verdict`.
|
|
92
|
+
- `comments` is required and must be an array. Use an empty array when no
|
|
93
|
+
verified inline comment is appropriate.
|
|
94
|
+
- Paths are repository-relative. `side` and `start_side` are `LEFT` or
|
|
95
|
+
`RIGHT`; `start_line` is used only for a multi-line range.
|
|
96
|
+
|
|
97
|
+
Before finishing, validate JSON and, when an annotated diff is available, run:
|
|
98
|
+
|
|
99
|
+
```sh
|
|
100
|
+
python3 .agents/skills/review/scripts/validate_review_json.py \
|
|
101
|
+
--review-json review.json --diff pr_diff.txt
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
If that path is unavailable, run the validator from this skill's `scripts/`
|
|
105
|
+
directory. Then render the review for human inspection:
|
|
106
|
+
|
|
107
|
+
```sh
|
|
108
|
+
python3 .agents/skills/review/scripts/render_review.py \
|
|
109
|
+
--review-json review.json --output review.html
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
The renderer creates a self-contained Excalidraw-inspired dark HTML report.
|
|
113
|
+
The final artifacts are `review.json` and `review.html`.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# Examples
|
|
2
2
|
|
|
3
|
-
- Review
|
|
4
|
-
-
|
|
5
|
-
-
|
|
3
|
+
- Review staged and unstaged local changes, then write a structured `review.json`.
|
|
4
|
+
- Review a GitHub pull request with `gh pr view` and `gh pr diff`, or a GitLab merge request with `glab mr view` and `glab mr diff`.
|
|
5
|
+
- Check correctness, tests, performance, security, and maintainability; never publish comments or approvals.
|
|
6
|
+
- Render the completed `review.json` to `review.html` for a visual, dark-mode review summary.
|