jianshuo/claude-skills / wjs-looping-feedback
wjs-looping-feedback
VerifiedUse when the user wants to add an in-site feedback loop to a website repo — a floating "提个建议" button where allowlisted visitors submit suggestions that become a GitHub Issue, which GitHub Actions turns into an automatic code change via Claude Code, auto-merges and deploys, and records on a /_feedback dashboard with one-click revert. Triggers — "给网站加个反馈对话框", "提一句话就自动改网站", "装上反馈闭环", "feedback loop", "/wjs-looping-feedback".
| File | Kind | Size |
|---|---|---|
| .gitignore | other | 24 B |
| README.md | markdown | 294 B |
| SKILL.md | skill md | 3.1 KB |
| assets/INSTRUCTIONS.md | markdown | 1.4 KB |
| assets/config.sample.json | config | 43 B |
| assets/feedback-finalize.mjs | script | 1.4 KB |
| assets/feedback-ledger.json | config | 20 B |
| assets/feedback-lib.mjs | script | 2.9 KB |
| assets/feedback-widget.html | other | 2.0 KB |
| assets/feedback.yml | config | 5.8 KB |
| package.json | manifest | 144 B |
| references/install.md | markdown | 5.9 KB |
| scripts/detect-site.mjs | script | 803 B |
| tests/detect-site.test.mjs | script | 1.3 KB |
| tests/finalize.test.mjs | script | 3.0 KB |
| tests/lib.test.mjs | script | 3.7 KB |
references/install.md
View on GitHub# Install playbook — wjs-looping-feedback
Follow these steps in the **target website repo** (the user's current working directory).
Ask the user only TWO things: the allowlist usernames and which auth to use (OAuth token or API key).
## 0. Preconditions
- Confirm the cwd is a git repo with a GitHub remote: `gh repo view --json nameWithOwner -q .nameWithOwner`.
Save this as `<REPO>`. If `gh` is not authenticated, ask the user to run `gh auth login`.
## 1. Detect the site type
Run the bundled detector against the repo root:
`node <SKILL_DIR>/scripts/detect-site.mjs .`
Map the result to a dashboard output path and a widget injection target:
| type | config.json `out` | inject widget into |
|---------|----------------------------------|------------------------------------------------------|
| hugo | `static/_feedback/index.html` | `layouts/partials/feedback-widget.html` included before `</body>` in `layouts/_default/baseof.html` (copy baseof from the theme into project `layouts/_default/` first if absent) |
| nextjs | `public/_feedback/index.html` | a raw block / `<Script>` in `app/layout.tsx` or `pages/_document` before `</body>` |
| astro | `public/_feedback/index.html` | before `</body>` in `src/layouts/*.astro` base layout |
| static | `_feedback/index.html` | before `</body>` in every top-level `*.html` (or the shared template/partial if one exists) |
| node | `public/_feedback/index.html` | inspect the project to find the HTML shell; ask the user if ambiguous |
| unknown | `_feedback/index.html` | ask the user where the site's HTML shell lives |
Confirm the chosen `out` directory is actually published at the site root (Hugo `static/` and most
`public/` dirs are copied verbatim, so `/_feedback` resolves). If unsure, ask the user.
## 2. Copy runtime assets into the target repo
Create `.feedback/` and copy from `<SKILL_DIR>/assets/`:
- `feedback-lib.mjs`, `feedback-finalize.mjs`, `INSTRUCTIONS.md`, `feedback-ledger.json`
- Copy `config.sample.json` to `.feedback/config.json`, then set its `out` to the path chosen in step 1.
- Append `.feedback/last-summary.txt` to the target repo's `.gitignore` (create `.gitignore` if absent) so the transient summary file is never committed.
Copy the workflow:
- `.github/workflows/feedback.yml` (from `assets/feedback.yml`, unchanged)
## 3. Inject the widget
- Copy `assets/feedback-widget.html`, replace `{{REPO}}` with `<REPO>`.
- Insert it at the injection target from step 1 (before `</body>`). For Hugo, prefer creating
`layouts/partials/feedback-widget.html` and adding `{{ partial "feedback-widget.html" . }}`
before `</body>` in the project's `baseof.html`.
## 4. Ask the user the inputs, then set repo config
- Ask: "允许哪些 GitHub 用户名提交反馈?(逗号分隔)" → `<ALLOWLIST>`
- Ask which auth to use:
- **Pro/Max 订阅(推荐)**: have the user run `claude setup-token` locally and paste the token → `<OAUTH>`, then `gh secret set CLAUDE_CODE_OAUTH_TOKEN -b "<OAUTH>"`
- **API key**: `gh secret set ANTHROPIC_API_KEY -b "<KEY>"`
Set exactly ONE of the two secrets.
- Apply:
```bash
gh variable set FEEDBACK_ALLOWLIST -b "<ALLOWLIST>"
# then ONE of:
gh secret set CLAUDE_CODE_OAUTH_TOKEN -b "<OAUTH>" # Pro/Max
gh secret set ANTHROPIC_API_KEY -b "<KEY>" # API billing
gh label create feedback -c "0e8a16" --force
gh label create revert -c "b60205" --force
```
- Ensure Actions can push to `main`:
`gh api -X PUT repos/<REPO>/actions/permissions/workflow -f default_workflow_permissions=write`
## 4.5 Wire up deploy triggering (DON'T SKIP — site won't go live otherwise)
The feedback workflow pushes the change to `main` with the built-in `GITHUB_TOKEN`. Whether
that push actually deploys depends on how the site ships. Determine the deploy mechanism and
act accordingly:
- **External push-deploy host** — Cloudflare Pages (git-connected), Vercel, Netlify, etc.
Their integration webhook fires on every push, including `GITHUB_TOKEN` pushes, so the
bot's commit deploys with no extra wiring. **Nothing to do.**
- **Deploy is a GitHub Actions workflow in THIS repo** — most commonly **GitHub Pages via
Actions** (`actions/deploy-pages`), or any custom `on: push` build-and-deploy workflow.
GitHub's recursion-prevention rule means a push made with `GITHUB_TOKEN` will **not**
trigger another workflow, so that deploy workflow's `on: push` never fires and the change
lands on `main` but never goes live. **Fix:** add a `workflow_run` trigger to the deploy
workflow so it runs after the feedback loop completes:
```yaml
on:
push:
branches: [main]
workflow_dispatch:
workflow_run:
workflows: ["feedback-loop"] # must match `name:` in feedback.yml
types: [completed]
```
(`feedback-loop` is the `name:` of the workflow in `feedback.yml`.) If the repo has no
deploy workflow yet (fresh GitHub Pages site), create one — a standard Hugo/Next/Astro →
Pages build workflow with the three triggers above — and set Pages source to "GitHub
Actions" (`gh api -X POST repos/<REPO>/pages -f build_type=workflow`).
- **Manual / local deploy** (e.g. local `wrangler`): the loop still lands changes on `main`,
but they won't auto-deploy. Tell the user this explicitly so they know to deploy.
Verify after the first real feedback run that a deploy actually fired and the change is live.
## 5. Commit and push
```bash
git add .feedback .github/workflows/feedback.yml <widget-target-files>
git commit -m "Add wjs-looping-feedback: in-site feedback → auto-edit → auto-deploy loop"
git push
```
## 6. Tell the user how to verify
"打开网站,点右下角『💬 提个建议』,输入一句改动建议并提交 → 在 GitHub 上 Submit 那个
预填好的 issue → 观察 Actions 跑完 → 刷新网站看改动 → 访问 /_feedback 看台账并可一键回滚。"
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deployment | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |