@ssheleg/sheleg-dev 0.6.0 → 0.7.0

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.
Files changed (36) hide show
  1. package/CHANGELOG.md +256 -0
  2. package/README.md +101 -1
  3. package/SECURITY.md +190 -52
  4. package/bin/sheleg-dev.js +18 -0
  5. package/package.json +2 -2
  6. package/plugins/sheleg-dev/.claude-plugin/plugin.json +1 -1
  7. package/plugins/sheleg-dev/hooks/hooks.json +29 -0
  8. package/plugins/sheleg-dev/hooks/lib/moneygate.js +587 -0
  9. package/plugins/sheleg-dev/hooks/money-gate.js +68 -0
  10. package/plugins/sheleg-dev/skills/ad-tracking/SKILL.md +7 -3
  11. package/plugins/sheleg-dev/skills/ad-tracking/fixtures/README.md +76 -0
  12. package/plugins/sheleg-dev/skills/ad-tracking/fixtures/assert-dedup-contract.mjs +249 -0
  13. package/plugins/sheleg-dev/skills/ad-tracking/fixtures/manifest.json +75 -0
  14. package/plugins/sheleg-dev/skills/ad-tracking/fixtures/purchase-capi-from-thank-you-page.json +32 -0
  15. package/plugins/sheleg-dev/skills/ad-tracking/fixtures/purchase-capi-server.json +26 -0
  16. package/plugins/sheleg-dev/skills/ad-tracking/fixtures/purchase-pixel-browser.json +12 -0
  17. package/plugins/sheleg-dev/skills/ad-tracking/fixtures/reference-emitter.mjs +129 -0
  18. package/plugins/sheleg-dev/skills/ad-tracking/references/meta-linkedin.md +13 -1
  19. package/plugins/sheleg-dev/skills/crypto-payments/SKILL.md +68 -0
  20. package/plugins/sheleg-dev/skills/crypto-payments/references/heleket-provider.md +349 -10
  21. package/plugins/sheleg-dev/skills/stripe-billing/SKILL.md +1 -1
  22. package/plugins/sheleg-dev/skills/stripe-billing/fixtures/README.md +110 -0
  23. package/plugins/sheleg-dev/skills/stripe-billing/fixtures/assert-money-invariants.mjs +404 -0
  24. package/plugins/sheleg-dev/skills/stripe-billing/fixtures/charge-refunded-partial.json +52 -0
  25. package/plugins/sheleg-dev/skills/stripe-billing/fixtures/charge-refunded-remainder.json +63 -0
  26. package/plugins/sheleg-dev/skills/stripe-billing/fixtures/checkout-session-async-payment-failed.json +43 -0
  27. package/plugins/sheleg-dev/skills/stripe-billing/fixtures/checkout-session-completed-async-unpaid.json +43 -0
  28. package/plugins/sheleg-dev/skills/stripe-billing/fixtures/checkout-session-completed-paid.json +42 -0
  29. package/plugins/sheleg-dev/skills/stripe-billing/fixtures/invoice-paid-subscription-cycle-next-period.json +70 -0
  30. package/plugins/sheleg-dev/skills/stripe-billing/fixtures/invoice-paid-subscription-cycle-redelivery.json +70 -0
  31. package/plugins/sheleg-dev/skills/stripe-billing/fixtures/invoice-paid-subscription-cycle.json +61 -0
  32. package/plugins/sheleg-dev/skills/stripe-billing/fixtures/invoice-paid-subscription-update-proration.json +90 -0
  33. package/plugins/sheleg-dev/skills/stripe-billing/fixtures/manifest.json +172 -0
  34. package/plugins/sheleg-dev/skills/stripe-billing/fixtures/reference-handler.mjs +315 -0
  35. package/plugins/sheleg-dev/skills/stripe-billing/references/testing-and-local-dev.md +38 -2
  36. package/plugins/sheleg-dev/skills/stripe-billing/references/webhook-events.md +43 -1
package/SECURITY.md CHANGED
@@ -1,63 +1,201 @@
1
1
  # Security
2
2
 
3
- ## What this skill actually does on your machine
4
-
5
- `sheleg-dev` is documentation plus one small Python script. Installed, it is:
6
-
7
- | Component | Runtime behavior |
8
- |---|---|
9
- | `SKILL.md` + `references/*.md` | Text. Read by the agent, executes nothing. |
10
- | `scripts/page_audit.py` | Runs only when you or the agent invokes it. Python **standard library only** — no dependencies, no install step. |
11
- | `commands/`, `cursor/rules/` | Text read by the host agent. |
12
- | `bin/sheleg-dev.js` (npm installer) | Copies the skill directory and the slash command into `~/.claude/`. No network, no post-install script. |
13
-
14
- There is no telemetry, no analytics, no phone-home, and nothing writes outside
15
- the paths above.
16
-
17
- ## Network behavior of `page_audit.py`
18
-
19
- - Plain `GET` requests, **http and https only** — any other scheme (`file://`,
20
- `ftp://`, `gopher://`, …) is refused before a request is made, and a redirect
21
- that leaves http(s) is refused too.
22
- - Only to URLs **you** pass via `--url` / `--url-list`. In `--file` mode it makes
23
- no requests at all, which is how the test suite runs.
24
- - No cookies, no credentials, no auth headers; a plain User-Agent that identifies
25
- the tool.
26
- - Bounded: `--timeout` (default 20s) and `--max-bytes` (default 5 MB). A declared
27
- content type that is not HTML/XHTML/XML is refused rather than parsed.
28
- - Read-only: results go to stdout. The script never writes a file. The only files
29
- it ever **reads** are the two you name yourself (`--file`, `--url-list`).
30
-
31
- ## What the skill will not tell an agent to do
32
-
33
- The audit procedure is explicitly **defensive**. Manipulative tactics —
34
- cloaking, fabricated consensus networks, review manipulation, click-signal
35
- spoofing, takedown abuse — appear only in `references/threats-and-defense.md`,
36
- written as *detect and withstand*, and the skill's non-negotiables forbid
37
- recommending them.
38
-
39
- The procedure is also read-only by default: it will not submit forms, request
40
- indexing, disavow links or change a live property without explicit approval in
41
- the session.
3
+ `sheleg-dev` is six skills about the layer a product reaches once it has users.
4
+ Five of them touch other people's money or identity — Stripe billing, crypto
5
+ payments, ad and conversion tracking, Google sign-in, server-side Google auth —
6
+ and the sixth is front-end performance. That subject is the reason this document
7
+ has to be exact about the pack itself.
8
+
9
+ Everything below is checkable from a clone, and the commands at the end are the
10
+ checks. **If one of them does not run, that is a defect in this document** —
11
+ please report it as one. Until this rewrite the file was a wholesale copy of a
12
+ sibling skill's, published in the npm tarball: it described a Python auditor this
13
+ repository has never had, and closed with a "verify for yourself" block whose
14
+ second and third commands exited 2. `test/validate.py` now refuses any path these
15
+ documents name that does not exist here.
16
+
17
+ ## What ships, and what of it executes
18
+
19
+ `git ls-files plugins` returns **50 files: 28 markdown, one plugin manifest, three
20
+ files of the manual gate, and 18 files of money fixtures.** Two of the six skills now
21
+ ship code you can run — the assertion packs under `fixtures/` — and that is a change
22
+ from every release before v0.7.0, so it is stated here rather than left to be noticed.
23
+ They run only when you invoke them, read only the JSON fixtures beside them, and open
24
+ no socket; the greps below prove all three.
25
+
26
+ | Component | Count | Runtime behavior |
27
+ |---|---|---|
28
+ | `SKILL.md`, one per skill | 6 | Text. Read by the agent, executes nothing. |
29
+ | `references/` files, loaded on demand | 20 | Text. Same. |
30
+ | `plugins/sheleg-dev/.claude-plugin/plugin.json` | 1 | Manifest read by Claude Code. |
31
+ | `plugins/sheleg-dev/hooks/hooks.json` | 1 | Hook manifest read by Claude Code. Declares one `PreToolUse` hook and no `if` filter. |
32
+ | `plugins/sheleg-dev/hooks/money-gate.js` | 1 | Runs on a tool call, when the plugin is enabled. Requires `path` and its own decision module — nothing else. Reads stdin, writes one JSON line, exits 0 on every path. |
33
+ | `plugins/sheleg-dev/hooks/lib/moneygate.js` | 1 | Pure. Payload and environment in, verdict out. No `require` at all, no filesystem, no clock. |
34
+ | `bin/sheleg-dev.js` — the npm installer | 1 | Runs only when you invoke it. Node built-ins only: `fs`, `path`, `os`. |
35
+ | `install.sh` — the shell installer | 1 | Runs only when you invoke it. Coreutils only: `cd`, `pwd`, `dirname`, `basename`, `mkdir`, `rm`, `cp`, `echo`. |
36
+ | `plugins/sheleg-dev/skills/*/fixtures/*.json` — webhook payloads | 12 | Data. Placeholder ids only; no key, token, signing secret or real customer id. |
37
+ | `plugins/sheleg-dev/skills/*/fixtures/*.mjs` — the assertion packs and their reference implementations | 4 | Runs only when you invoke it. Reads the JSON beside it with `readFileSync` and nothing else: no `child_process`, no `fetch`, no write, no `process.env`. |
38
+ | `plugins/sheleg-dev/skills/*/fixtures/manifest.json` and its `README.md` | 4 | Text. The invariant-to-fixture-to-document map, which `test/validate.py` reads. |
39
+
40
+ The published tarball is those plus `README.md`, `CHANGELOG.md`, `SECURITY.md`,
41
+ `LICENSE` and `package.json` — 56 files, listed by `npm pack --dry-run`.
42
+
43
+ **The gate can refuse a command and can never run one.** `money-gate.js` requires
44
+ `path` and the decision module; the decision module requires nothing. There is no
45
+ `child_process`, no `fetch`, no `http`, no `fs` on either path — so the strongest
46
+ thing it can do to your session is print a denial, and the strongest thing a bug
47
+ in it can do is print nothing. It reads `process.env` for one variable pair
48
+ (`SHELEG_DEV_LIVE_AUTHORISED`, `SHELEG_DEV_MONEY_GATE`) and the environment
49
+ declaration a run already carries, and it never writes to any file. `README.md` →
50
+ *The manual gate* is its single home.
51
+
52
+ **There are no npm lifecycle scripts.** `package.json` declares exactly one
53
+ script, `test`. Installing this package, or reaching it through `npx`, runs
54
+ nothing but the CLI you typed.
55
+
56
+ ## What the installers read and write
57
+
58
+ Both do one thing: copy the six skill directories out of the package into
59
+ `~/.claude/skills/<name>`.
60
+
61
+ - **Read:** only files inside the package.
62
+ - **Write:** only `~/.claude/skills/` — six directories, named for the six skills.
63
+ Nothing else on the filesystem, nothing outside `$HOME`.
64
+ - **Network: none.** Neither file opens a socket or resolves a hostname.
65
+ `bin/sheleg-dev.js` requires `fs`, `path` and `os` and nothing else — no
66
+ `child_process`, no `fetch`, no `http` — so it spawns no process at all;
67
+ `install.sh` runs only the coreutils named above. The grep below prints the
68
+ whole surface of both files in eleven lines.
69
+ - **No telemetry, no analytics, no phone-home.** Nothing here has anywhere to
70
+ send anything.
71
+
72
+ **One destructive difference between the two installers.** `bin/sheleg-dev.js`
73
+ skips a skill that is already installed and says so, unless you pass `--force`
74
+ (`bin/sheleg-dev.js:45-46`). `install.sh` does not ask: for each of the six names
75
+ it runs `rm -rf` on the destination and re-copies, every time
76
+ (`install.sh:21-22`). If you have hand-edited an installed skill, the shell
77
+ installer deletes your edits and the node installer does not.
78
+
79
+ ## Credentials
80
+
81
+ **This pack handles payment credentials as a subject and never as a value.** It
82
+ reads no credential, stores none, transmits none, logs none. It is markdown; it
83
+ could not.
84
+
85
+ What it contains is credential *names*, inside example code you adapt —
86
+ `STRIPE_SECRET_KEY`, `STRIPE_WEBHOOK_SECRET`, `HELEKET_API_KEY`,
87
+ `GOOGLE_CLIENT_ID`, `GOOGLE_CLIENT_SECRET`. No real key ships. The grep below
88
+ searches the whole skill payload for live-key shapes and returns exactly one line
89
+ — a `-----BEGIN RSA PRIVATE KEY-----\n...` placeholder inside a service-account
90
+ JSON example, at
91
+ `plugins/sheleg-dev/skills/google-auth/references/adc-and-service-accounts.md:236`.
92
+ The pack's own position on live keys, that one in a repository is an incident
93
+ rather than a lint warning, is at
94
+ `plugins/sheleg-dev/skills/stripe-billing/references/stripe-agent-toolchain.md:156`.
95
+
96
+ `.env` and `.env.*` are gitignored here, `.env.example` excepted.
97
+
98
+ ## What the advice can lead an agent to run
99
+
100
+ The pack executes nothing — but it tells an agent what to run, and some of those
101
+ commands move real credentials. Every one is a vendor's own tool, invoked by you
102
+ or by an agent you approved:
103
+
104
+ - `stripe login` and `stripe agent setup` — browser consent, then a written CLI
105
+ profile. The reference marks the login a human step:
106
+ `plugins/sheleg-dev/skills/stripe-billing/references/stripe-agent-toolchain.md:36-37`
107
+ - `stripe listen`, `stripe trigger`, `stripe logs tail` — use the profile the CLI
108
+ already holds:
109
+ `plugins/sheleg-dev/skills/stripe-billing/references/testing-and-local-dev.md:24-51`
110
+ - `gcloud auth application-default login` — mints a local credential file:
111
+ `plugins/sheleg-dev/skills/google-auth/references/adc-and-service-accounts.md:50-57`
112
+ - `gcloud iam workload-identity-pools create-cred-config` — writes a
113
+ credential-configuration file:
114
+ `plugins/sheleg-dev/skills/google-auth/references/workload-identity.md:127`
115
+ - `claude mcp add --transport http stripe https://mcp.stripe.com/` — OAuth
116
+ consent to **Stripe's own MCP server**, which can make live calls against your
117
+ account:
118
+ `plugins/sheleg-dev/skills/stripe-billing/references/stripe-agent-toolchain.md:106-107`
119
+
120
+ The last is the one to weigh. This pack *points at* Stripe's MCP server and does
121
+ not install, proxy or wrap it; if you connect it, that account access is between
122
+ you and Stripe. The same file states the key hygiene the pack expects — restricted
123
+ `rk_` keys, one per service, minimum permissions, a secrets vault in preference to
124
+ environment variables, never in source and never in logs:
125
+ `plugins/sheleg-dev/skills/stripe-billing/references/stripe-agent-toolchain.md:144-158`.
126
+
127
+ ## What this pack never does
128
+
129
+ - It never charges, refunds, rotates or revokes anything. It has no code that could
130
+ — and since 2026-08-19 it ships a hook whose whole purpose is to stop an *agent*
131
+ from doing so unasked. `README.md` → *The manual gate*.
132
+ - It never asks for a key, and has nowhere to send one.
133
+ - It does not choose your payment processor. Licensing, AML programme and
134
+ sanctions exposure are a business and compliance decision, and `README.md` says
135
+ so where a reader meets the crypto skill.
136
+
137
+ ## Where the real risk is
138
+
139
+ Not the bytes — the advice. These six skills describe Stripe, Heleket and BTCPay,
140
+ Google Sign-In, Workload Identity Federation, four ad platforms and browser
141
+ defaults, and every one of those changes. **A claim here that a provider has since
142
+ changed is a security defect in this pack**, not merely a stale doc, and it is the
143
+ exposure `docs/evidence/verification.md` names as the largest one this repository
144
+ does not test. `CONTRIBUTING.md` requires a claim about what a provider does
145
+ *today* to carry the date it was true. If you find one that has rotted, report it
146
+ with what the correct claim is and what backs it.
42
147
 
43
148
  ## Reporting a problem
44
149
 
45
- Open an issue at <https://github.com/ssheleg/sheleg-dev/issues>. If it is
46
- sensitive, say so in the issue without the details and a private channel will be
47
- arranged.
150
+ Open an issue: <https://github.com/ssheleg/sheleg-dev/issues>. **For a security
151
+ problem, do not put the details in a public issue** — open one saying you have
152
+ found something, and a private channel will be arranged.
48
153
 
49
154
  ## Verifying for yourself
50
155
 
51
156
  ```bash
52
157
  git clone https://github.com/ssheleg/sheleg-dev && cd sheleg-dev
53
- python3 test/validate.py # structure, version sync, references, links, anchors
54
- python3 test/test_page_audit.py # auditor behavior, offline fixtures + scheme guard
55
- grep -rnE "urlopen|build_opener|opener\.open|socket|subprocess|os\.system|\beval\(|\bexec\(|\bopen\(" \
56
- plugins/sheleg-dev/skills/sheleg-dev/scripts/page_audit.py
57
- ```
58
158
 
59
- The last command prints the auditor's entire I/O surface — six lines: the
60
- `urllib.request` import, one comment, the opener that carries the scheme guard,
61
- the one `opener.open(...)` call, and the two `open()` calls that read the file
62
- paths you pass on the command line. No `subprocess`, no `os.system`, no `eval`,
63
- no `exec`, no raw sockets. Everything else in `plugins/` is markdown.
159
+ # The whole gate: version sync across four manifests, front matter inside the
160
+ # Agent Skills limits, references resolving both directions, and every path the
161
+ # self-describing documents name -- this file included.
162
+ python3 test/validate.py
163
+
164
+ # The shipped payload: 50 files.
165
+ git ls-files plugins
166
+
167
+ # 22 lines: the plugin manifest, the three files of the manual gate, and the 18
168
+ # files of money fixtures. Everything else in the payload is markdown.
169
+ git ls-files plugins | grep -v '\.md$'
170
+
171
+ # Every require the gate makes: two lines, both in the hook -- `path`, and its own
172
+ # decision module. The decision module makes none.
173
+ grep -nE "\brequire\(" plugins/sheleg-dev/hooks/money-gate.js plugins/sheleg-dev/hooks/lib/moneygate.js
174
+
175
+ # What it cannot reach: NO OUTPUT, and grep exits 1 because it matched nothing.
176
+ grep -nE "child_process|\bfetch\(|require\('(http|https|net|fs|dns|tls)'\)|spawn\(|execFile|writeFile|appendFile|unlink" \
177
+ plugins/sheleg-dev/hooks/money-gate.js plugins/sheleg-dev/hooks/lib/moneygate.js
178
+
179
+ # Both directions of the gate, watched: 65 fixtures, refusals and allow-plants.
180
+ node test/moneygate_test.js
181
+
182
+ # The money fixtures: both assertion packs against their reference implementation, both
183
+ # --self-test runs, and three plants that neuter an assertion. 13 checks.
184
+ node test/fixtures_test.js
185
+
186
+ # What the assertion packs cannot reach: NO OUTPUT, and grep exits 1 because it
187
+ # matched nothing. `readFileSync` of the fixtures beside them is their whole I/O.
188
+ grep -rnE "child_process|\bfetch\(|require\('(http|https|net|dns|tls)'\)|spawn\(|execFile|writeFileSync|appendFileSync|unlinkSync|process\.env\." \
189
+ plugins/sheleg-dev/skills/*/fixtures/*.mjs
190
+
191
+ # The entire I/O surface of the only two executable files: eleven lines. Three
192
+ # built-in requires, the copy/mkdir/remove calls, homedir, and install.sh's
193
+ # rm -rf + cp -R. No process, no socket, no network.
194
+ grep -nE "require|child_process|exec|spawn|fetch|socket|rm -rf|cp -R|copyFileSync|mkdirSync|rmSync|homedir" bin/sheleg-dev.js install.sh
195
+
196
+ # Live-key shapes across the skill payload: one line, and it is a placeholder.
197
+ grep -rnE "sk_live_[A-Za-z0-9]|rk_live_[A-Za-z0-9]|whsec_[A-Za-z0-9]{8}|BEGIN [A-Z ]*PRIVATE KEY" plugins
198
+
199
+ # What npm publishes, and nothing else: 56 files.
200
+ npm pack --dry-run
201
+ ```
package/bin/sheleg-dev.js CHANGED
@@ -93,6 +93,24 @@ function main(argv) {
93
93
  force
94
94
  );
95
95
  }
96
+
97
+ // The manual gate does not travel this way, and saying so is the whole of what this
98
+ // installer can honestly do about it. `plugins/sheleg-dev/hooks/` is a PreToolUse hook
99
+ // that refuses a refund, a payout, a live key and the free-money path; the plugin
100
+ // channel loads it from the plugin manifest, this channel copies skills only.
101
+ //
102
+ // **It is a notice, not an install.** Writing to a person's `~/.claude/settings.json`
103
+ // is the one thing this repository must never do unasked: it is a file the operator
104
+ // owns and did not write, with no version control behind it, and the family umbrella
105
+ // carries two defects in its own history from doing exactly that. So the step is
106
+ // printed and left to the reader — README.md, "The manual gate", carries the JSON.
107
+ if (fs.existsSync(path.join(ROOT, 'plugins/sheleg-dev/hooks/hooks.json'))) {
108
+ console.log('');
109
+ console.log('Note: the manual gate (a PreToolUse hook refusing refunds, payouts, live');
110
+ console.log('keys and SKIP_BILLING in production) ships with the PLUGIN, not with this');
111
+ console.log('skills copy. To get it here, register it yourself — README.md, section');
112
+ console.log('"The manual gate", has the settings snippet. Nothing enforces this step.');
113
+ }
96
114
  return 0;
97
115
  }
98
116
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ssheleg/sheleg-dev",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "description": "Six integration skills for the layer a product reaches once it has users: Stripe subscription billing, crypto payments, ad and conversion tracking under Consent Mode v2, Google sign-in and the wider Google auth surface, and Core Web Vitals. This package is the installer CLI.",
5
5
  "bin": {
6
6
  "sheleg-dev": "bin/sheleg-dev.js"
@@ -43,6 +43,6 @@
43
43
  "skill"
44
44
  ],
45
45
  "scripts": {
46
- "test": "python3 test/validate.py"
46
+ "test": "python3 test/validate.py && node test/moneygate_test.js && node test/fixtures_test.js"
47
47
  }
48
48
  }
@@ -2,7 +2,7 @@
2
2
  "name": "sheleg-dev",
3
3
  "displayName": "Sheleg Dev",
4
4
  "description": "The integration layer a product needs once it has users: Stripe subscription billing reconciled into your own database, crypto payments that survive over-payment and duplicate webhooks, ad and conversion tracking under Consent Mode v2, Google sign-in with the account-linking guards, the wider Google auth surface, and Core Web Vitals work that moves the score.",
5
- "version": "0.6.0",
5
+ "version": "0.7.0",
6
6
  "author": {
7
7
  "name": "ssheleg",
8
8
  "url": "https://x.com/sshlg93"
@@ -0,0 +1,29 @@
1
+ {
2
+ "description": "sheleg-dev — the manual gate. A PreToolUse hook that refuses money movement, an irreversible action, live production access and the pack's own free-money path unless the authorised person has signed the category off for this session. Deliberately carries NO `if` filter: the reference calls that filter best-effort and says it fails open on a command it cannot parse, so the decision is made in lib/moneygate.js instead. Exits 0 on every path, so a project that never touches payments sees nothing.",
3
+ "hooks": {
4
+ "PreToolUse": [
5
+ {
6
+ "matcher": "Bash",
7
+ "hooks": [
8
+ {
9
+ "type": "command",
10
+ "command": "node \"${CLAUDE_PLUGIN_ROOT}/hooks/money-gate.js\"",
11
+ "statusMessage": "manual gate: money movement and live access",
12
+ "timeout": 15
13
+ }
14
+ ]
15
+ },
16
+ {
17
+ "matcher": "mcp__.*",
18
+ "hooks": [
19
+ {
20
+ "type": "command",
21
+ "command": "node \"${CLAUDE_PLUGIN_ROOT}/hooks/money-gate.js\"",
22
+ "statusMessage": "manual gate: money movement and live access",
23
+ "timeout": 15
24
+ }
25
+ ]
26
+ }
27
+ ]
28
+ }
29
+ }