@mohammadhprp/system-prompt 0.12.4 → 0.12.5
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/review.md +5 -20
- 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/package.json +1 -1
- package/src/catalog.js +4 -2
|
@@ -1,24 +1,9 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
2
|
+
description: Review local, GitHub, or GitLab changes and write review.json
|
|
3
3
|
agent: plan
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
Review
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
## Process
|
|
11
|
-
|
|
12
|
-
1. **Review conversation and diff** - Read conversation history, run `git diff` for staged/unstaged changes, identify the problem being solved and the behavior being modified. Read related standards: [`references/standards/naming.md`](../references/standards/naming.md), [`references/standards/testing.md`](../references/standards/testing.md), [`references/standards/security.md`](../references/standards/security.md), [`references/standards/performance.md`](../references/standards/performance.md).
|
|
13
|
-
|
|
14
|
-
2. **Check correctness** - Edge cases, concurrency, error handling, state transitions, backward compatibility. Read contracts and interfaces before implementation.
|
|
15
|
-
|
|
16
|
-
3. **Check maintainability** - Naming reflects business meaning, structure matches project conventions, comments explain why not what.
|
|
17
|
-
|
|
18
|
-
4. **Check testing** - Do tests prove the behavior change? Missing edge cases or failure paths? Tests should verify behavior, not mirror implementation.
|
|
19
|
-
|
|
20
|
-
5. **Check performance** - N+1 queries, unbounded loops, unnecessary allocations, caching opportunities.
|
|
21
|
-
|
|
22
|
-
6. **Check security** - Input validation, authentication enforcement, secrets exposure, least privilege.
|
|
23
|
-
|
|
24
|
-
7. **Present findings** - Distinguish blockers from suggestions, explain reasoning for each, summarize overall risk and production readiness.
|
|
6
|
+
Review `$ARGUMENTS` using the `review` skill. Select local changes, a GitHub
|
|
7
|
+
pull request, or a GitLab merge request from the arguments. Use `gh` or `glab`
|
|
8
|
+
for read-only remote inspection, never publish comments, and write the required
|
|
9
|
+
`review.json` artifact.
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gh
|
|
3
|
+
description: Expert guidance for using the GitHub CLI (gh) to work with repositories, issues, pull requests, Actions, releases, and the GitHub API from the command line. Use this skill whenever the user needs to perform a GitHub workflow or asks to use gh.
|
|
4
|
+
allowed-tools: Bash, Read, Grep, Glob
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# GitHub CLI (`gh`) Skill
|
|
8
|
+
|
|
9
|
+
Use the official `gh` CLI for GitHub operations instead of manually constructing API requests or browser workflows when a supported command exists.
|
|
10
|
+
|
|
11
|
+
## When to Use This Skill
|
|
12
|
+
|
|
13
|
+
Invoke when the user needs to:
|
|
14
|
+
|
|
15
|
+
- Inspect, create, edit, review, merge, or close pull requests
|
|
16
|
+
- Search, create, edit, comment on, or close issues
|
|
17
|
+
- Inspect repositories, branches, releases, tags, or notifications
|
|
18
|
+
- View, rerun, cancel, or inspect logs for GitHub Actions workflows
|
|
19
|
+
- Create and manage releases
|
|
20
|
+
- Query or mutate GitHub resources through the API
|
|
21
|
+
|
|
22
|
+
## Prerequisites and Authentication
|
|
23
|
+
|
|
24
|
+
Verify that the CLI is installed before executing commands:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
gh --version
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Check the active account and token scopes:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
gh auth status
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
If authentication is missing, use the interactive login flow:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
gh auth login
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
For automation, prefer a short-lived `GH_TOKEN` or `GITHUB_TOKEN` environment variable. Never print, commit, or include token values in command output, issue bodies, pull requests, or logs.
|
|
43
|
+
|
|
44
|
+
## Repository Context
|
|
45
|
+
|
|
46
|
+
Most commands infer the repository from the current Git remote. Confirm context when it matters:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
git remote -v
|
|
50
|
+
gh repo view --json nameWithOwner,defaultBranchRef
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Use `--repo OWNER/REPO` when running outside a checkout or targeting another repository.
|
|
54
|
+
|
|
55
|
+
## Core Workflows
|
|
56
|
+
|
|
57
|
+
### Pull Requests
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
# List and inspect PRs
|
|
61
|
+
gh pr list --state open
|
|
62
|
+
gh pr view 123 --comments
|
|
63
|
+
|
|
64
|
+
# Create a PR after pushing the branch
|
|
65
|
+
git push -u origin HEAD
|
|
66
|
+
gh pr create --base main --title "Add feature" --body "Summary and testing notes"
|
|
67
|
+
|
|
68
|
+
# Review a PR
|
|
69
|
+
gh pr checkout 123
|
|
70
|
+
gh pr diff 123
|
|
71
|
+
gh pr review 123 --approve
|
|
72
|
+
|
|
73
|
+
# Merge only after the user has explicitly approved the merge
|
|
74
|
+
gh pr merge 123 --squash --delete-branch
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Prefer `--body-file` for substantial descriptions and `--json` with `--jq` for reliable scripting. Before creating or updating a PR, inspect repository templates and existing branch commits when the workflow requires them.
|
|
78
|
+
|
|
79
|
+
### Issues
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
gh issue list --state open --assignee @me
|
|
83
|
+
gh issue view 123 --comments
|
|
84
|
+
gh issue create --title "Bug report" --body-file bug.md --label bug
|
|
85
|
+
gh issue comment 123 --body "Investigation is complete."
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Use `--repo OWNER/REPO` for issues in another repository. Treat closing, reopening, editing, and deleting issues as mutating operations that require clear user intent.
|
|
89
|
+
|
|
90
|
+
### GitHub Actions
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
gh run list --limit 20
|
|
94
|
+
gh run view RUN_ID
|
|
95
|
+
gh run view RUN_ID --log-failed
|
|
96
|
+
gh run watch RUN_ID
|
|
97
|
+
gh workflow run workflow.yml --ref main
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Confirm the workflow name, ref, and inputs before dispatching a workflow. Do not rerun or cancel runs without user authorization.
|
|
101
|
+
|
|
102
|
+
### Releases and Repositories
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
gh release list
|
|
106
|
+
gh release view v1.2.3
|
|
107
|
+
gh release create v1.2.3 --generate-notes
|
|
108
|
+
gh repo view OWNER/REPO
|
|
109
|
+
gh repo clone OWNER/REPO
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Creating, editing, or deleting releases and repositories is destructive or externally visible; confirm the target and requested changes first.
|
|
113
|
+
|
|
114
|
+
## API and Scripting
|
|
115
|
+
|
|
116
|
+
Use structured output rather than parsing human-readable tables:
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
gh pr list --json number,title,state --jq '.[] | [.number, .title, .state] | @tsv'
|
|
120
|
+
gh api repos/OWNER/REPO/issues --paginate --jq '.[] | [.number, .title] | @tsv'
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
For API mutations, state the HTTP method and target before execution and ask for confirmation when the operation changes remote data:
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
gh api repos/OWNER/REPO/issues --method POST \
|
|
127
|
+
-f title='Bug report' -f body='Details'
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
Use `gh <command> --help` and `gh api --help` when exact flags or endpoint behavior is uncertain. Prefer `--paginate` for collection endpoints and constrain fields with `--jq` to avoid exposing unnecessary data.
|
|
131
|
+
|
|
132
|
+
## Best Practices
|
|
133
|
+
|
|
134
|
+
1. Run `gh auth status` before diagnosing authentication failures.
|
|
135
|
+
2. Check `git status`, the current branch, and the remote before PR or release work.
|
|
136
|
+
3. Use `--repo OWNER/REPO` rather than changing directories solely to select a repository.
|
|
137
|
+
4. Use `--json`/`--jq` for scripts and `--body-file` for multiline content.
|
|
138
|
+
5. Confirm before pushing, merging, closing, deleting, dispatching, rerunning, or cancelling remote work.
|
|
139
|
+
6. Do not bypass branch protection or approval requirements unless the user explicitly requests it and has authority.
|
|
140
|
+
|
|
141
|
+
## Common Problems
|
|
142
|
+
|
|
143
|
+
- **`gh: command not found`** — Install GitHub CLI and verify it is on `PATH`.
|
|
144
|
+
- **Authentication or scope errors** — Run `gh auth status`, then `gh auth refresh` or `gh auth login` as appropriate.
|
|
145
|
+
- **Wrong repository** — Check `git remote -v` and pass `--repo OWNER/REPO` explicitly.
|
|
146
|
+
- **PR cannot merge** — Inspect `gh pr checks NUMBER`, mergeability, required reviews, and branch protection.
|
|
147
|
+
- **Workflow dispatch fails** — Confirm the workflow supports `workflow_dispatch`, the ref exists, and required inputs are supplied.
|
|
148
|
+
- **API returns 404** — Verify repository spelling and that the authenticated account can access it.
|
|
149
|
+
|
|
150
|
+
## Quick Reference
|
|
151
|
+
|
|
152
|
+
- `gh repo view` — View the current repository
|
|
153
|
+
- `gh pr list` / `gh pr view NUMBER` / `gh pr create` — Pull request workflows
|
|
154
|
+
- `gh issue list` / `gh issue view NUMBER` / `gh issue create` — Issue workflows
|
|
155
|
+
- `gh run list` / `gh run view ID` / `gh run watch ID` — Actions workflows
|
|
156
|
+
- `gh release list` / `gh release create TAG` — Release workflows
|
|
157
|
+
- `gh api ENDPOINT` — GitHub REST or GraphQL API access
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Examples
|
|
2
|
+
|
|
3
|
+
- Check `gh auth status` and repository context before performing GitHub operations.
|
|
4
|
+
- List open pull requests, inspect a specific PR with comments and checks, and summarize its status without changing remote data.
|
|
5
|
+
- Prepare a pull request from the current branch by reviewing commits and templates, then show the proposed title and body before creating it.
|
|
6
|
+
- Search issues with structured `--json` and `--jq` output, avoiding fragile parsing of terminal tables.
|
|
7
|
+
- Inspect a failed GitHub Actions run with `gh run view RUN_ID --log-failed` and summarize the relevant failure.
|
|
8
|
+
- Create or dispatch a workflow only after confirming the workflow, ref, and inputs with the user.
|
|
9
|
+
- Use `gh api` for an endpoint not covered by a subcommand, preferring read-only requests and requesting confirmation before mutations.
|
|
10
|
+
- Ask for explicit confirmation before pushing, merging, closing, deleting, rerunning, cancelling, or publishing remote resources.
|
|
@@ -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.
|