rlhf-feedback-loop 0.5.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 (73) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/LICENSE +21 -0
  3. package/README.md +308 -0
  4. package/adapters/README.md +8 -0
  5. package/adapters/amp/skills/rlhf-feedback/SKILL.md +20 -0
  6. package/adapters/chatgpt/INSTALL.md +80 -0
  7. package/adapters/chatgpt/openapi.yaml +292 -0
  8. package/adapters/claude/.mcp.json +8 -0
  9. package/adapters/codex/config.toml +4 -0
  10. package/adapters/gemini/function-declarations.json +95 -0
  11. package/adapters/mcp/server-stdio.js +444 -0
  12. package/bin/cli.js +167 -0
  13. package/config/mcp-allowlists.json +29 -0
  14. package/config/policy-bundles/constrained-v1.json +53 -0
  15. package/config/policy-bundles/default-v1.json +80 -0
  16. package/config/rubrics/default-v1.json +52 -0
  17. package/config/subagent-profiles.json +32 -0
  18. package/openapi/openapi.yaml +292 -0
  19. package/package.json +91 -0
  20. package/plugins/amp-skill/INSTALL.md +52 -0
  21. package/plugins/amp-skill/SKILL.md +31 -0
  22. package/plugins/claude-skill/INSTALL.md +55 -0
  23. package/plugins/claude-skill/SKILL.md +46 -0
  24. package/plugins/codex-profile/AGENTS.md +20 -0
  25. package/plugins/codex-profile/INSTALL.md +57 -0
  26. package/plugins/gemini-extension/INSTALL.md +74 -0
  27. package/plugins/gemini-extension/gemini_prompt.txt +10 -0
  28. package/plugins/gemini-extension/tool_contract.json +28 -0
  29. package/scripts/billing.js +471 -0
  30. package/scripts/budget-guard.js +173 -0
  31. package/scripts/code-reasoning.js +307 -0
  32. package/scripts/context-engine.js +547 -0
  33. package/scripts/contextfs.js +513 -0
  34. package/scripts/contract-audit.js +198 -0
  35. package/scripts/dpo-optimizer.js +208 -0
  36. package/scripts/export-dpo-pairs.js +316 -0
  37. package/scripts/export-training.js +448 -0
  38. package/scripts/feedback-attribution.js +313 -0
  39. package/scripts/feedback-inbox-read.js +162 -0
  40. package/scripts/feedback-loop.js +838 -0
  41. package/scripts/feedback-schema.js +300 -0
  42. package/scripts/feedback-to-memory.js +165 -0
  43. package/scripts/feedback-to-rules.js +109 -0
  44. package/scripts/generate-paperbanana-diagrams.sh +99 -0
  45. package/scripts/hybrid-feedback-context.js +676 -0
  46. package/scripts/intent-router.js +164 -0
  47. package/scripts/mcp-policy.js +92 -0
  48. package/scripts/meta-policy.js +194 -0
  49. package/scripts/plan-gate.js +154 -0
  50. package/scripts/prove-adapters.js +364 -0
  51. package/scripts/prove-attribution.js +364 -0
  52. package/scripts/prove-automation.js +393 -0
  53. package/scripts/prove-data-quality.js +219 -0
  54. package/scripts/prove-intelligence.js +256 -0
  55. package/scripts/prove-lancedb.js +370 -0
  56. package/scripts/prove-loop-closure.js +255 -0
  57. package/scripts/prove-rlaif.js +404 -0
  58. package/scripts/prove-subway-upgrades.js +250 -0
  59. package/scripts/prove-training-export.js +324 -0
  60. package/scripts/prove-v2-milestone.js +273 -0
  61. package/scripts/prove-v3-milestone.js +381 -0
  62. package/scripts/rlaif-self-audit.js +123 -0
  63. package/scripts/rubric-engine.js +230 -0
  64. package/scripts/self-heal.js +127 -0
  65. package/scripts/self-healing-check.js +111 -0
  66. package/scripts/skill-quality-tracker.js +284 -0
  67. package/scripts/subagent-profiles.js +79 -0
  68. package/scripts/sync-gh-secrets-from-env.sh +29 -0
  69. package/scripts/thompson-sampling.js +331 -0
  70. package/scripts/train_from_feedback.py +914 -0
  71. package/scripts/validate-feedback.js +580 -0
  72. package/scripts/vector-store.js +100 -0
  73. package/src/api/server.js +497 -0
@@ -0,0 +1,80 @@
1
+ {
2
+ "bundleId": "default-v1",
3
+ "version": 1,
4
+ "description": "Balanced autonomous execution bundle with human checkpoints on high-risk actions.",
5
+ "defaultMcpProfile": "default",
6
+ "approval": {
7
+ "requiredRisks": ["high", "critical"],
8
+ "profileOverrides": {
9
+ "default": ["high", "critical"],
10
+ "readonly": ["high", "critical"],
11
+ "locked": ["medium", "high", "critical"]
12
+ }
13
+ },
14
+ "intents": [
15
+ {
16
+ "id": "capture_feedback_loop",
17
+ "description": "Capture user outcome and update memory artifacts.",
18
+ "risk": "low",
19
+ "actions": [
20
+ {
21
+ "kind": "mcp_tool",
22
+ "name": "capture_feedback"
23
+ },
24
+ {
25
+ "kind": "mcp_tool",
26
+ "name": "feedback_summary"
27
+ }
28
+ ]
29
+ },
30
+ {
31
+ "id": "improve_response_quality",
32
+ "description": "Summarize recent failures and regenerate prevention rules.",
33
+ "risk": "medium",
34
+ "actions": [
35
+ {
36
+ "kind": "mcp_tool",
37
+ "name": "feedback_summary"
38
+ },
39
+ {
40
+ "kind": "mcp_tool",
41
+ "name": "prevention_rules"
42
+ },
43
+ {
44
+ "kind": "mcp_tool",
45
+ "name": "construct_context_pack"
46
+ }
47
+ ]
48
+ },
49
+ {
50
+ "id": "publish_dpo_training_data",
51
+ "description": "Export DPO preference pairs for model improvement pipelines.",
52
+ "risk": "high",
53
+ "actions": [
54
+ {
55
+ "kind": "mcp_tool",
56
+ "name": "export_dpo_pairs"
57
+ }
58
+ ]
59
+ },
60
+ {
61
+ "id": "incident_postmortem",
62
+ "description": "Construct evidence pack and record evaluation for incident review.",
63
+ "risk": "medium",
64
+ "actions": [
65
+ {
66
+ "kind": "mcp_tool",
67
+ "name": "construct_context_pack"
68
+ },
69
+ {
70
+ "kind": "mcp_tool",
71
+ "name": "context_provenance"
72
+ },
73
+ {
74
+ "kind": "mcp_tool",
75
+ "name": "evaluate_context_pack"
76
+ }
77
+ ]
78
+ }
79
+ ]
80
+ }
@@ -0,0 +1,52 @@
1
+ {
2
+ "rubricId": "default-v1",
3
+ "version": 1,
4
+ "description": "Rubric for coding-agent response quality and operational safety.",
5
+ "criteria": [
6
+ {
7
+ "id": "correctness",
8
+ "label": "Technical correctness",
9
+ "weight": 0.3,
10
+ "minPassingScore": 3
11
+ },
12
+ {
13
+ "id": "verification_evidence",
14
+ "label": "Verification evidence quality",
15
+ "weight": 0.25,
16
+ "minPassingScore": 3,
17
+ "requiresEvidence": true
18
+ },
19
+ {
20
+ "id": "safety",
21
+ "label": "Safety and guardrail compliance",
22
+ "weight": 0.2,
23
+ "minPassingScore": 3
24
+ },
25
+ {
26
+ "id": "instruction_following",
27
+ "label": "Instruction following",
28
+ "weight": 0.15,
29
+ "minPassingScore": 3
30
+ },
31
+ {
32
+ "id": "clarity",
33
+ "label": "Clarity and communication",
34
+ "weight": 0.1,
35
+ "minPassingScore": 2
36
+ }
37
+ ],
38
+ "guardrails": [
39
+ {
40
+ "key": "testsPassed",
41
+ "label": "Required tests passed"
42
+ },
43
+ {
44
+ "key": "pathSafety",
45
+ "label": "Path/file safety checks passed"
46
+ },
47
+ {
48
+ "key": "budgetCompliant",
49
+ "label": "Budget compliance maintained"
50
+ }
51
+ ]
52
+ }
@@ -0,0 +1,32 @@
1
+ {
2
+ "version": 1,
3
+ "profiles": {
4
+ "pr_workflow": {
5
+ "description": "Prepare PR metadata and feedback evidence while keeping write operations constrained.",
6
+ "mcpProfile": "default",
7
+ "skills": ["change-report", "feedback-summary"],
8
+ "context": {
9
+ "maxItems": 8,
10
+ "maxChars": 6000
11
+ }
12
+ },
13
+ "review_workflow": {
14
+ "description": "Read-heavy code review and risk analysis profile.",
15
+ "mcpProfile": "readonly",
16
+ "skills": ["code-review", "verification"],
17
+ "context": {
18
+ "maxItems": 10,
19
+ "maxChars": 7000
20
+ }
21
+ },
22
+ "secure_runtime": {
23
+ "description": "Minimal profile for constrained environments.",
24
+ "mcpProfile": "locked",
25
+ "skills": ["feedback-summary"],
26
+ "context": {
27
+ "maxItems": 5,
28
+ "maxChars": 3000
29
+ }
30
+ }
31
+ }
32
+ }
@@ -0,0 +1,292 @@
1
+ openapi: 3.1.0
2
+ info:
3
+ title: RLHF Feedback Loop API
4
+ version: 1.1.0
5
+ description: |
6
+ Production API for feedback capture, schema-validated memory promotion,
7
+ prevention rule generation, and DPO export.
8
+ servers:
9
+ - url: http://localhost:8787
10
+ security:
11
+ - bearerAuth: []
12
+ components:
13
+ securitySchemes:
14
+ bearerAuth:
15
+ type: http
16
+ scheme: bearer
17
+ bearerFormat: API Key
18
+ schemas:
19
+ RubricScore:
20
+ type: object
21
+ required: [criterion, score]
22
+ properties:
23
+ criterion:
24
+ type: string
25
+ score:
26
+ type: number
27
+ minimum: 1
28
+ maximum: 5
29
+ evidence:
30
+ type: string
31
+ judge:
32
+ type: string
33
+ CaptureFeedbackRequest:
34
+ type: object
35
+ required: [signal, context]
36
+ properties:
37
+ signal:
38
+ type: string
39
+ enum: [up, down, positive, negative]
40
+ context:
41
+ type: string
42
+ whatWentWrong:
43
+ type: string
44
+ whatToChange:
45
+ type: string
46
+ whatWorked:
47
+ type: string
48
+ rubricScores:
49
+ type: array
50
+ items:
51
+ $ref: '#/components/schemas/RubricScore'
52
+ guardrails:
53
+ type: object
54
+ properties:
55
+ testsPassed:
56
+ type: boolean
57
+ pathSafety:
58
+ type: boolean
59
+ budgetCompliant:
60
+ type: boolean
61
+ tags:
62
+ oneOf:
63
+ - type: array
64
+ items:
65
+ type: string
66
+ - type: string
67
+ skill:
68
+ type: string
69
+ IntentPlanRequest:
70
+ type: object
71
+ required: [intentId]
72
+ properties:
73
+ intentId:
74
+ type: string
75
+ context:
76
+ type: string
77
+ mcpProfile:
78
+ type: string
79
+ bundleId:
80
+ type: string
81
+ approved:
82
+ type: boolean
83
+ paths:
84
+ /healthz:
85
+ get:
86
+ operationId: healthz
87
+ responses:
88
+ '200':
89
+ description: Service health
90
+ '401':
91
+ description: Unauthorized
92
+ /v1/feedback/capture:
93
+ post:
94
+ operationId: captureFeedback
95
+ requestBody:
96
+ required: true
97
+ content:
98
+ application/json:
99
+ schema:
100
+ $ref: '#/components/schemas/CaptureFeedbackRequest'
101
+ responses:
102
+ '200':
103
+ description: Feedback accepted and promoted to memory
104
+ '422':
105
+ description: Feedback recorded but rejected for memory promotion
106
+ '401':
107
+ description: Unauthorized
108
+ /v1/feedback/stats:
109
+ get:
110
+ operationId: getFeedbackStats
111
+ responses:
112
+ '200':
113
+ description: Aggregated feedback statistics
114
+ '401':
115
+ description: Unauthorized
116
+ /v1/intents/catalog:
117
+ get:
118
+ operationId: listIntentCatalog
119
+ parameters:
120
+ - in: query
121
+ name: mcpProfile
122
+ schema:
123
+ type: string
124
+ - in: query
125
+ name: bundleId
126
+ schema:
127
+ type: string
128
+ responses:
129
+ '200':
130
+ description: Intent catalog with risk and checkpoint metadata
131
+ '401':
132
+ description: Unauthorized
133
+ /v1/intents/plan:
134
+ post:
135
+ operationId: planIntent
136
+ requestBody:
137
+ required: true
138
+ content:
139
+ application/json:
140
+ schema:
141
+ $ref: '#/components/schemas/IntentPlanRequest'
142
+ responses:
143
+ '200':
144
+ description: Policy-scoped intent execution plan
145
+ '400':
146
+ description: Invalid intent request
147
+ '401':
148
+ description: Unauthorized
149
+ /v1/feedback/summary:
150
+ get:
151
+ operationId: getFeedbackSummary
152
+ parameters:
153
+ - in: query
154
+ name: recent
155
+ schema:
156
+ type: integer
157
+ default: 20
158
+ responses:
159
+ '200':
160
+ description: Feedback summary text
161
+ '401':
162
+ description: Unauthorized
163
+ /v1/feedback/rules:
164
+ post:
165
+ operationId: generatePreventionRules
166
+ requestBody:
167
+ required: false
168
+ content:
169
+ application/json:
170
+ schema:
171
+ type: object
172
+ properties:
173
+ minOccurrences:
174
+ type: integer
175
+ default: 2
176
+ outputPath:
177
+ type: string
178
+ responses:
179
+ '200':
180
+ description: Prevention rules generated
181
+ '401':
182
+ description: Unauthorized
183
+ /v1/dpo/export:
184
+ post:
185
+ operationId: exportDpoPairs
186
+ requestBody:
187
+ required: false
188
+ content:
189
+ application/json:
190
+ schema:
191
+ type: object
192
+ properties:
193
+ inputPath:
194
+ type: string
195
+ memoryLogPath:
196
+ type: string
197
+ outputPath:
198
+ type: string
199
+ responses:
200
+ '200':
201
+ description: DPO export completed
202
+ '401':
203
+ description: Unauthorized
204
+ /v1/context/construct:
205
+ post:
206
+ operationId: constructContextPack
207
+ requestBody:
208
+ required: false
209
+ content:
210
+ application/json:
211
+ schema:
212
+ type: object
213
+ properties:
214
+ query:
215
+ type: string
216
+ maxItems:
217
+ type: integer
218
+ default: 8
219
+ maxChars:
220
+ type: integer
221
+ default: 6000
222
+ namespaces:
223
+ type: array
224
+ items:
225
+ type: string
226
+ enum:
227
+ - raw_history
228
+ - memory/error
229
+ - memory/learning
230
+ - rules
231
+ - tools
232
+ - provenance
233
+ responses:
234
+ '200':
235
+ description: Context pack created
236
+ '400':
237
+ description: Invalid namespace selection
238
+ '401':
239
+ description: Unauthorized
240
+ /v1/context/evaluate:
241
+ post:
242
+ operationId: evaluateContextPack
243
+ requestBody:
244
+ required: true
245
+ content:
246
+ application/json:
247
+ schema:
248
+ type: object
249
+ required: [packId, outcome]
250
+ properties:
251
+ packId:
252
+ type: string
253
+ outcome:
254
+ type: string
255
+ signal:
256
+ type: string
257
+ notes:
258
+ type: string
259
+ rubricScores:
260
+ type: array
261
+ items:
262
+ $ref: '#/components/schemas/RubricScore'
263
+ guardrails:
264
+ type: object
265
+ properties:
266
+ testsPassed:
267
+ type: boolean
268
+ pathSafety:
269
+ type: boolean
270
+ budgetCompliant:
271
+ type: boolean
272
+ responses:
273
+ '200':
274
+ description: Evaluation recorded
275
+ '400':
276
+ description: Invalid rubric payload
277
+ '401':
278
+ description: Unauthorized
279
+ /v1/context/provenance:
280
+ get:
281
+ operationId: getContextProvenance
282
+ parameters:
283
+ - in: query
284
+ name: limit
285
+ schema:
286
+ type: integer
287
+ default: 50
288
+ responses:
289
+ '200':
290
+ description: Recent provenance events
291
+ '401':
292
+ description: Unauthorized
package/package.json ADDED
@@ -0,0 +1,91 @@
1
+ {
2
+ "name": "rlhf-feedback-loop",
3
+ "version": "0.5.0",
4
+ "description": "Production-grade RLHF feedback operations for coding agents: capture thumbs signals, enforce schema quality, prevent repeated mistakes, and export DPO pairs.",
5
+ "main": "scripts/feedback-loop.js",
6
+ "bin": {
7
+ "rlhf-feedback-loop": "./bin/cli.js"
8
+ },
9
+ "files": [
10
+ "bin/",
11
+ "scripts/",
12
+ "src/",
13
+ "adapters/",
14
+ "plugins/",
15
+ "openapi/",
16
+ "config/",
17
+ "README.md",
18
+ "LICENSE",
19
+ "CHANGELOG.md"
20
+ ],
21
+ "type": "commonjs",
22
+ "scripts": {
23
+ "test": "npm run test:schema && npm run test:loop && npm run test:dpo && npm run test:api && npm run test:proof && npm run test:e2e && npm run test:rlaif && npm run test:attribution && npm run test:quality && npm run test:intelligence && npm run test:training-export && npm run test:deployment && npm run test:billing && npm run test:cli",
24
+ "test:e2e": "node --test tests/e2e-pipeline.test.js",
25
+ "test:schema": "node scripts/feedback-schema.js --test",
26
+ "test:loop": "node scripts/feedback-loop.js --test",
27
+ "test:dpo": "node scripts/export-dpo-pairs.js --test",
28
+ "test:api": "node --test tests/api-server.test.js tests/api-auth-config.test.js tests/mcp-server.test.js tests/adapters.test.js tests/openapi-parity.test.js tests/budget-guard.test.js tests/contextfs.test.js tests/mcp-policy.test.js tests/subagent-profiles.test.js tests/intent-router.test.js tests/rubric-engine.test.js tests/self-healing-check.test.js tests/self-heal.test.js tests/feedback-schema.test.js tests/thompson-sampling.test.js tests/feedback-sequences.test.js tests/diversity-tracking.test.js tests/vector-store.test.js tests/feedback-attribution.test.js tests/hybrid-feedback-context.test.js tests/loop-closure.test.js tests/code-reasoning.test.js",
29
+ "test:proof": "node --test tests/prove-adapters.test.js tests/prove-automation.test.js",
30
+ "test:rlaif": "node --test tests/rlaif-self-audit.test.js tests/dpo-optimizer.test.js tests/meta-policy.test.js",
31
+ "test:attribution": "node --test tests/feedback-attribution.test.js tests/hybrid-feedback-context.test.js",
32
+ "test:quality": "node --test tests/validate-feedback.test.js",
33
+ "test:intelligence": "node --test tests/intelligence.test.js",
34
+ "test:training-export": "node --test tests/training-export.test.js",
35
+ "test:deployment": "node --test tests/deployment.test.js",
36
+ "test:billing": "node --test tests/billing.test.js",
37
+ "test:cli": "node --test tests/cli.test.js",
38
+ "start:api": "node src/api/server.js",
39
+ "start:mcp": "node adapters/mcp/server-stdio.js",
40
+ "feedback:capture": "node .claude/scripts/feedback/capture-feedback.js",
41
+ "feedback:stats": "node .claude/scripts/feedback/capture-feedback.js --stats",
42
+ "feedback:summary": "node .claude/scripts/feedback/capture-feedback.js --summary",
43
+ "feedback:rules": "node .claude/scripts/feedback/capture-feedback.js --rules",
44
+ "feedback:export:dpo": "node scripts/export-dpo-pairs.js --from-local --output .claude/memory/feedback/dpo-pairs.jsonl",
45
+ "budget:status": "node scripts/budget-guard.js --status",
46
+ "diagrams:paperbanana": "bash scripts/generate-paperbanana-diagrams.sh",
47
+ "prove:adapters": "node scripts/prove-adapters.js",
48
+ "prove:automation": "node scripts/prove-automation.js",
49
+ "prove:lancedb": "node scripts/prove-lancedb.js",
50
+ "prove:rlaif": "node scripts/prove-rlaif.js",
51
+ "prove:attribution": "node scripts/prove-attribution.js",
52
+ "prove:data-quality": "node scripts/prove-data-quality.js",
53
+ "prove:loop-closure": "node scripts/prove-loop-closure.js",
54
+ "prove:intelligence": "node scripts/prove-intelligence.js",
55
+ "prove:training-export": "node scripts/prove-training-export.js",
56
+ "prove:v2-milestone": "node scripts/prove-v2-milestone.js",
57
+ "feedback:export:pytorch": "node scripts/export-training.js --pytorch",
58
+ "feedback:export:csv": "node scripts/export-training.js --csv",
59
+ "feedback:export:actions": "node scripts/export-training.js --actions",
60
+ "prove:subway-upgrades": "node scripts/prove-subway-upgrades.js",
61
+ "self-heal:check": "node scripts/self-healing-check.js",
62
+ "self-heal:run": "node scripts/self-heal.js --reason=manual",
63
+ "intents:list": "node scripts/intent-router.js",
64
+ "intents:plan": "node scripts/intent-router.js --intent=publish_dpo_training_data",
65
+ "ml:dpo": "node scripts/dpo-optimizer.js --run",
66
+ "ml:meta-policy": "node scripts/meta-policy.js --extract",
67
+ "ml:train": "python3 scripts/train_from_feedback.py --train",
68
+ "ml:incremental": "python3 scripts/train_from_feedback.py --incremental",
69
+ "ml:reliability": "python3 scripts/train_from_feedback.py --reliability",
70
+ "ml:sample": "python3 scripts/train_from_feedback.py --sample"
71
+ },
72
+ "keywords": [
73
+ "rlhf",
74
+ "dpo",
75
+ "ai-agents",
76
+ "llmops",
77
+ "preference-learning",
78
+ "feedback-loop",
79
+ "claude",
80
+ "codex",
81
+ "gemini",
82
+ "agent-evaluation",
83
+ "prompt-engineering"
84
+ ],
85
+ "license": "MIT",
86
+ "dependencies": {
87
+ "@huggingface/transformers": "^3.8.1",
88
+ "@lancedb/lancedb": "^0.26.2",
89
+ "apache-arrow": "^18.1.0"
90
+ }
91
+ }
@@ -0,0 +1,52 @@
1
+ # Amp: RLHF Feedback Skill Install
2
+
3
+ Install the RLHF skill for Amp in under 60 seconds. No manual file editing required.
4
+
5
+ ## One-Command Install
6
+
7
+ ```bash
8
+ cp plugins/amp-skill/SKILL.md .amp/skills/rlhf-feedback.md
9
+ ```
10
+
11
+ Or from the npm package:
12
+
13
+ ```bash
14
+ npx rlhf-feedback-loop init
15
+ cp node_modules/rlhf-feedback-loop/plugins/amp-skill/SKILL.md .amp/skills/rlhf-feedback.md
16
+ ```
17
+
18
+ ## What This Does
19
+
20
+ Copies the skill definition to `.amp/skills/` so Amp loads it automatically on next launch.
21
+
22
+ ## Verify
23
+
24
+ After copying, restart Amp. The skill will appear in the active skills list.
25
+
26
+ Then test:
27
+
28
+ ```bash
29
+ node .rlhf/capture-feedback.js --feedback=up --context="amp skill install verified" --tags="install"
30
+ ```
31
+
32
+ ## Available Commands (via skill)
33
+
34
+ ```bash
35
+ # Positive feedback
36
+ node .rlhf/capture-feedback.js --feedback=up --context="..." --tags="..."
37
+
38
+ # Negative feedback
39
+ node .rlhf/capture-feedback.js --feedback=down --context="..." --what-went-wrong="..." --what-to-change="..." --tags="..."
40
+ ```
41
+
42
+ ## Requirements
43
+
44
+ - Amp (any version with skills support)
45
+ - Node.js 18+ in PATH
46
+ - `.rlhf/` directory (created by `npx rlhf-feedback-loop init`)
47
+
48
+ ## Uninstall
49
+
50
+ ```bash
51
+ rm .amp/skills/rlhf-feedback.md
52
+ ```
@@ -0,0 +1,31 @@
1
+ ---
2
+ name: rlhf-feedback
3
+ description: Capture thumbs feedback and apply prevention rules before coding
4
+ ---
5
+
6
+ # Amp RLHF Skill
7
+
8
+ On explicit user feedback:
9
+
10
+ ```bash
11
+ node .rlhf/capture-feedback.js --feedback=up --context="..." --tags="..."
12
+ node .rlhf/capture-feedback.js --feedback=down --context="..." --what-went-wrong="..." --what-to-change="..." --tags="..."
13
+ ```
14
+
15
+ Before major implementation:
16
+
17
+ ```bash
18
+ node .rlhf/capture-feedback.js --feedback=up --context="session start" --tags="session" 2>/dev/null || true
19
+ ```
20
+
21
+ ## Triggers
22
+
23
+ - "thumbs up" / "that worked" / "looks good"
24
+ - "thumbs down" / "that failed" / "that was wrong"
25
+
26
+ ## Negative Triggers (do NOT activate for)
27
+
28
+ - "generate code"
29
+ - "search files"
30
+ - "explain this"
31
+ - "run tests"
@@ -0,0 +1,55 @@
1
+ # Claude Code: RLHF Feedback Skill Install
2
+
3
+ Install the skill in under 60 seconds. No manual file editing required.
4
+
5
+ ## One-Command Install
6
+
7
+ ```bash
8
+ cp plugins/claude-skill/SKILL.md .claude/skills/rlhf-feedback.md
9
+ ```
10
+
11
+ Or from the published npm package:
12
+
13
+ ```bash
14
+ npx rlhf-feedback-loop init
15
+ cp node_modules/rlhf-feedback-loop/plugins/claude-skill/SKILL.md .claude/skills/rlhf-feedback.md
16
+ ```
17
+
18
+ ## What This Does
19
+
20
+ Copies the skill definition to `.claude/skills/` so Claude Code loads it automatically on next launch.
21
+
22
+ The skill activates on triggers: "thumbs up", "thumbs down", "that worked", "that failed".
23
+
24
+ ## Verify
25
+
26
+ After copying, restart Claude Code and run:
27
+
28
+ ```bash
29
+ # Claude Code will show available skills:
30
+ # rlhf-feedback — Capture thumbs up/down feedback into structured memories
31
+ ```
32
+
33
+ Then test it:
34
+
35
+ ```bash
36
+ node .rlhf/capture-feedback.js --feedback=up --context="skill install verified" --tags="install"
37
+ ```
38
+
39
+ ## What You Get
40
+
41
+ - Automatic feedback capture on quality signals
42
+ - Prevention rules generated from repeated mistakes
43
+ - Session-start context loading: `npm run feedback:summary && npm run feedback:rules`
44
+
45
+ ## Requirements
46
+
47
+ - Claude Code (any version)
48
+ - Node.js 18+ in PATH
49
+ - `.rlhf/` directory (created by `npx rlhf-feedback-loop init`)
50
+
51
+ ## Uninstall
52
+
53
+ ```bash
54
+ rm .claude/skills/rlhf-feedback.md
55
+ ```