@codeharbor/agent-playbook 0.1.0 → 0.1.2
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/README.md +4 -2
- package/package.json +5 -2
- package/skills/api-designer/README.md +36 -0
- package/skills/api-designer/SKILL.md +232 -0
- package/skills/api-designer/references/graphql-patterns.md +12 -0
- package/skills/api-designer/references/rest-patterns.md +17 -0
- package/skills/api-designer/scripts/generate_api.py +87 -0
- package/skills/api-designer/scripts/validate_api.py +48 -0
- package/skills/api-documenter/README.md +41 -0
- package/skills/api-documenter/SKILL.md +209 -0
- package/skills/api-documenter/references/examples/README.md +3 -0
- package/skills/api-documenter/references/examples/openapi-example.yaml +10 -0
- package/skills/api-documenter/references/openapi-template.yaml +5 -0
- package/skills/api-documenter/scripts/generate_openapi.py +84 -0
- package/skills/api-documenter/scripts/validate_openapi.py +45 -0
- package/skills/architecting-solutions/README.md +22 -0
- package/skills/architecting-solutions/SKILL.md +459 -0
- package/skills/auto-trigger/README.md +23 -0
- package/skills/auto-trigger/SKILL.md +183 -0
- package/skills/code-reviewer/README.md +59 -0
- package/skills/code-reviewer/SKILL.md +220 -0
- package/skills/code-reviewer/references/checklist.md +80 -0
- package/skills/code-reviewer/references/patterns.md +226 -0
- package/skills/code-reviewer/references/security.md +88 -0
- package/skills/code-reviewer/scripts/review_checklist.py +191 -0
- package/skills/commit-helper/README.md +58 -0
- package/skills/commit-helper/SKILL.md +159 -0
- package/skills/commit-helper/references/conventional-commits.md +68 -0
- package/skills/commit-helper/references/examples.md +125 -0
- package/skills/commit-helper/references/scopes.md +49 -0
- package/skills/commit-helper/scripts/validate_commit.py +70 -0
- package/skills/create-pr/README.md +182 -0
- package/skills/create-pr/SKILL.md +340 -0
- package/skills/debugger/README.md +53 -0
- package/skills/debugger/SKILL.md +239 -0
- package/skills/debugger/references/checklist.md +7 -0
- package/skills/debugger/references/errors.md +6 -0
- package/skills/debugger/references/patterns.md +5 -0
- package/skills/debugger/scripts/debug_report.py +77 -0
- package/skills/deployment-engineer/README.md +40 -0
- package/skills/deployment-engineer/SKILL.md +242 -0
- package/skills/deployment-engineer/references/kubernetes.md +23 -0
- package/skills/deployment-engineer/references/monitoring.md +14 -0
- package/skills/deployment-engineer/references/pipelines.md +12 -0
- package/skills/deployment-engineer/scripts/generate_deploy.py +72 -0
- package/skills/deployment-engineer/scripts/validate_deploy.py +46 -0
- package/skills/documentation-engineer/README.md +41 -0
- package/skills/documentation-engineer/SKILL.md +164 -0
- package/skills/documentation-engineer/references/api-template.md +22 -0
- package/skills/documentation-engineer/references/readme-template.md +25 -0
- package/skills/documentation-engineer/references/style-guide.md +13 -0
- package/skills/documentation-engineer/scripts/generate_docs.py +68 -0
- package/skills/documentation-engineer/scripts/validate_docs.py +46 -0
- package/skills/figma-designer/README.md +222 -0
- package/skills/figma-designer/SKILL.md +407 -0
- package/skills/figma-designer/references/example-output.md +86 -0
- package/skills/performance-engineer/README.md +42 -0
- package/skills/performance-engineer/SKILL.md +236 -0
- package/skills/performance-engineer/references/checklist.md +6 -0
- package/skills/performance-engineer/references/monitoring.md +5 -0
- package/skills/performance-engineer/references/optimization.md +7 -0
- package/skills/performance-engineer/scripts/perf_report.py +64 -0
- package/skills/performance-engineer/scripts/profile.py +63 -0
- package/skills/planning-with-files/README.md +27 -0
- package/skills/planning-with-files/SKILL.md +103 -0
- package/skills/prd-implementation-precheck/README.md +97 -0
- package/skills/prd-implementation-precheck/SKILL.md +112 -0
- package/skills/prd-planner/README.md +102 -0
- package/skills/prd-planner/SKILL.md +449 -0
- package/skills/prd-planner/references/edge-case-analysis.md +111 -0
- package/skills/qa-expert/README.md +37 -0
- package/skills/qa-expert/SKILL.md +225 -0
- package/skills/qa-expert/references/gates.md +11 -0
- package/skills/qa-expert/references/metrics.md +6 -0
- package/skills/qa-expert/references/strategy.md +11 -0
- package/skills/qa-expert/scripts/coverage_analysis.py +61 -0
- package/skills/qa-expert/scripts/generate_test_plan.py +68 -0
- package/skills/refactoring-specialist/README.md +37 -0
- package/skills/refactoring-specialist/SKILL.md +283 -0
- package/skills/refactoring-specialist/references/checklist.md +6 -0
- package/skills/refactoring-specialist/references/smells.md +6 -0
- package/skills/refactoring-specialist/references/techniques.md +6 -0
- package/skills/security-auditor/README.md +48 -0
- package/skills/security-auditor/SKILL.md +256 -0
- package/skills/security-auditor/references/checklist.md +7 -0
- package/skills/security-auditor/references/owasp.md +12 -0
- package/skills/security-auditor/references/remediation.md +7 -0
- package/skills/security-auditor/scripts/find_secrets.py +58 -0
- package/skills/security-auditor/scripts/security_audit.py +64 -0
- package/skills/self-improving-agent/README.md +136 -0
- package/skills/self-improving-agent/SKILL.md +407 -0
- package/skills/self-improving-agent/hooks/post-bash.sh +10 -0
- package/skills/self-improving-agent/hooks/pre-tool.sh +10 -0
- package/skills/self-improving-agent/hooks/session-end.sh +4 -0
- package/skills/self-improving-agent/memory/semantic-patterns.json +288 -0
- package/skills/self-improving-agent/references/appendix.md +131 -0
- package/skills/self-improving-agent/templates/correction-template.md +11 -0
- package/skills/self-improving-agent/templates/pattern-template.md +15 -0
- package/skills/self-improving-agent/templates/validation-template.md +14 -0
- package/skills/session-logger/README.md +50 -0
- package/skills/session-logger/SKILL.md +156 -0
- package/skills/skill-router/README.md +155 -0
- package/skills/skill-router/SKILL.md +215 -0
- package/skills/test-automator/README.md +41 -0
- package/skills/test-automator/SKILL.md +202 -0
- package/skills/test-automator/references/best-practices.md +6 -0
- package/skills/test-automator/references/examples/README.md +3 -0
- package/skills/test-automator/references/examples/unit-test-example.md +8 -0
- package/skills/test-automator/references/mocking.md +5 -0
- package/skills/test-automator/scripts/coverage_report.py +59 -0
- package/skills/test-automator/scripts/generate_test.py +66 -0
- package/skills/workflow-orchestrator/README.md +20 -0
- package/skills/workflow-orchestrator/SKILL.md +342 -0
- package/src/cli.js +107 -20
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
{
|
|
2
|
+
"patterns": {
|
|
3
|
+
"prd_document_separation": {
|
|
4
|
+
"id": "pat-2025-01-11-001",
|
|
5
|
+
"name": "Document Separation for Complex PRDs",
|
|
6
|
+
"source": "user_feedback",
|
|
7
|
+
"confidence": 0.95,
|
|
8
|
+
"applications": 0,
|
|
9
|
+
"created": "2025-01-11",
|
|
10
|
+
"category": "prd_structure",
|
|
11
|
+
"pattern": "For non-trivial PRDs, split into 4 files with clear purposes",
|
|
12
|
+
"problem": "Single large PRD file (~500 lines) with mixed product/technical content is hard to follow",
|
|
13
|
+
"solution": {
|
|
14
|
+
"files": [
|
|
15
|
+
{
|
|
16
|
+
"name": "{name}-notes.md",
|
|
17
|
+
"purpose": "Thinking process, options analysis",
|
|
18
|
+
"audience": "Self + future reviewers"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"name": "{name}-task-plan.md",
|
|
22
|
+
"purpose": "Project tracking, phases, progress",
|
|
23
|
+
"audience": "PM + development lead"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"name": "{name}-prd.md",
|
|
27
|
+
"purpose": "Product requirements (what & why)",
|
|
28
|
+
"audience": "PM + stakeholders + developers"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"name": "{name}-tech.md",
|
|
32
|
+
"purpose": "Technical design (how)",
|
|
33
|
+
"audience": "Developers + architects"
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
},
|
|
37
|
+
"quality_rules": [
|
|
38
|
+
"PRD focuses on problem, goals, scope, user flows",
|
|
39
|
+
"Tech doc focuses on API, data flow, implementation",
|
|
40
|
+
"Notes document architecture options with A/B/C analysis",
|
|
41
|
+
"Task plan has checkboxes with timestamps",
|
|
42
|
+
"PRD references tech doc, doesn't duplicate"
|
|
43
|
+
],
|
|
44
|
+
"target_skills": ["prd-planner", "architecting-solutions"]
|
|
45
|
+
},
|
|
46
|
+
"state_monitoring_over_callbacks": {
|
|
47
|
+
"id": "pat-2025-01-11-002",
|
|
48
|
+
"name": "Direct State Monitoring vs Callbacks",
|
|
49
|
+
"source": "implementation_review",
|
|
50
|
+
"confidence": 0.90,
|
|
51
|
+
"applications": 0,
|
|
52
|
+
"created": "2025-01-11",
|
|
53
|
+
"category": "react_patterns",
|
|
54
|
+
"pattern": "Prefer direct state monitoring over callback chains for side effects",
|
|
55
|
+
"problem": "Callback chains passed through multiple layers are hard to trace and debug",
|
|
56
|
+
"solution": {
|
|
57
|
+
"anti_pattern": "useBorrowTxUpdate({ onRefresh: () => { /* refresh logic */ } });",
|
|
58
|
+
"pattern": "const pendingCount = txs.length;\nconst prevPendingCount = usePrevious(pendingCount);\nuseEffect(() => {\n if (pendingCount < prevPendingCount) {\n requestBorrowRefresh({ reason: 'completed' });\n }\n}, [pendingCount, prevPendingCount]);"
|
|
59
|
+
},
|
|
60
|
+
"when_to_use": [
|
|
61
|
+
"State changes need to trigger side effects",
|
|
62
|
+
"Callback chain would be 3+ layers deep",
|
|
63
|
+
"Multiple components need to react to same state change"
|
|
64
|
+
],
|
|
65
|
+
"quality_rules": [
|
|
66
|
+
"Use usePrevious to detect state changes instead of callbacks when feasible",
|
|
67
|
+
"Keep state monitoring close to where state is consumed",
|
|
68
|
+
"Use callbacks only for cross-component boundaries"
|
|
69
|
+
],
|
|
70
|
+
"target_skills": ["debugger", "refactoring-specialist"]
|
|
71
|
+
},
|
|
72
|
+
"state_machine_over_booleans": {
|
|
73
|
+
"id": "pat-2025-01-11-003",
|
|
74
|
+
"name": "State Machine Over Boolean Flags",
|
|
75
|
+
"source": "implementation_review",
|
|
76
|
+
"confidence": 0.85,
|
|
77
|
+
"applications": 0,
|
|
78
|
+
"created": "2025-01-11",
|
|
79
|
+
"category": "async_patterns",
|
|
80
|
+
"pattern": "Use state machines for async operations with multiple phases",
|
|
81
|
+
"problem": "Simple boolean flags can't represent 'waiting to run' vs 'currently running', causing race conditions",
|
|
82
|
+
"solution": {
|
|
83
|
+
"anti_pattern": "const inFlight = false;",
|
|
84
|
+
"pattern": "enum EStatus {\n Idle = 'idle',\n Waiting = 'waiting', // Scheduled but not running yet\n Running = 'running',\n}"
|
|
85
|
+
},
|
|
86
|
+
"benefits": [
|
|
87
|
+
"Prevents race conditions (can't schedule new request while running)",
|
|
88
|
+
"Distinguishes 'waiting to run' from 'currently running'",
|
|
89
|
+
"Easier to debug and log state transitions"
|
|
90
|
+
],
|
|
91
|
+
"quality_rules": [
|
|
92
|
+
"Use state machine for async operations with multiple phases",
|
|
93
|
+
"Prevent state transitions that don't make sense",
|
|
94
|
+
"Log state transitions for debugging"
|
|
95
|
+
],
|
|
96
|
+
"target_skills": ["debugger", "api-designer"]
|
|
97
|
+
},
|
|
98
|
+
"measurable_success_criteria": {
|
|
99
|
+
"id": "pat-2025-01-11-004",
|
|
100
|
+
"name": "Measurable Success Criteria",
|
|
101
|
+
"source": "user_feedback",
|
|
102
|
+
"confidence": 0.90,
|
|
103
|
+
"applications": 0,
|
|
104
|
+
"created": "2025-01-11",
|
|
105
|
+
"category": "prd_quality",
|
|
106
|
+
"pattern": "Success criteria must include specific numbers/timings to enable verification",
|
|
107
|
+
"problem": "Vague success criteria like 'data refreshes' don't enable testing or verification",
|
|
108
|
+
"solution": {
|
|
109
|
+
"bad_examples": [
|
|
110
|
+
"Data refreshes after transaction",
|
|
111
|
+
"Manual refresh works",
|
|
112
|
+
"No performance regression"
|
|
113
|
+
],
|
|
114
|
+
"good_examples": [
|
|
115
|
+
"BorrowHome data refreshes within 3-5 seconds after pending transaction completes",
|
|
116
|
+
"Manual refresh button triggers full refresh and shows loading state",
|
|
117
|
+
"API response time under 500ms for 95th percentile"
|
|
118
|
+
]
|
|
119
|
+
},
|
|
120
|
+
"quality_rules": [
|
|
121
|
+
"Success criteria include specific numbers/timings",
|
|
122
|
+
"Each criterion is objectively verifiable",
|
|
123
|
+
"Performance targets have percentiles (e.g., 95th, 99th)",
|
|
124
|
+
"User-facing behavior has observable indicators"
|
|
125
|
+
],
|
|
126
|
+
"target_skills": ["prd-planner", "architecting-solutions"]
|
|
127
|
+
},
|
|
128
|
+
"non_goals_section": {
|
|
129
|
+
"id": "pat-2025-01-11-005",
|
|
130
|
+
"name": "Non-Goals Section",
|
|
131
|
+
"source": "user_feedback",
|
|
132
|
+
"confidence": 0.90,
|
|
133
|
+
"applications": 0,
|
|
134
|
+
"created": "2025-01-11",
|
|
135
|
+
"category": "prd_structure",
|
|
136
|
+
"pattern": "Explicitly state what won't be done to prevent scope creep",
|
|
137
|
+
"problem": "Without explicit non-goals, scope creeps during implementation",
|
|
138
|
+
"solution": {
|
|
139
|
+
"structure": "## Goals\n- [Specific achievable outcomes]\n\n## Non-Goals\n- [Explicit exclusions - things that might seem related but aren't]"
|
|
140
|
+
},
|
|
141
|
+
"quality_rules": [
|
|
142
|
+
"Goals section has 3-5 focused items",
|
|
143
|
+
"Non-goals section explicitly excludes reasonable-but-out-of-scope items",
|
|
144
|
+
"Each non-goal has a brief rationale if not obvious"
|
|
145
|
+
],
|
|
146
|
+
"target_skills": ["prd-planner", "architecting-solutions"]
|
|
147
|
+
},
|
|
148
|
+
"ui_ux_specification_granularity": {
|
|
149
|
+
"id": "pat-2025-01-11-006",
|
|
150
|
+
"name": "UI/UX Specification Granularity",
|
|
151
|
+
"source": "retrospective",
|
|
152
|
+
"confidence": 0.95,
|
|
153
|
+
"applications": 0,
|
|
154
|
+
"created": "2025-01-11",
|
|
155
|
+
"category": "ui_patterns",
|
|
156
|
+
"pattern": "UI/UX PRDs require explicit visual specifications to prevent rework",
|
|
157
|
+
"problem": "Ambiguous UI specs (position, size, spacing) cause implementation rework",
|
|
158
|
+
"solution": {
|
|
159
|
+
"required_elements": {
|
|
160
|
+
"layout_structure": ["Relative position: same row / next row / below / above", "Parent-child container relationships", "Spacing values (gap, padding, margin)"],
|
|
161
|
+
"component_specs": ["Icon/Button sizes: iconSize=\"$4\" (24px)", "Text styles: size=\"$bodyMd\", color=\"$textSubdued\"", "Component variants: size=\"small\", variant=\"tertiary\""],
|
|
162
|
+
"visual_comparison": "Before/After ASCII art showing layout change",
|
|
163
|
+
"executable_criteria": "Checklist with exact prop values"
|
|
164
|
+
},
|
|
165
|
+
"examples": {
|
|
166
|
+
"bad": "Refresh button next to amount",
|
|
167
|
+
"good": "Refresh button in same XStack as amount with gap='$3'"
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
"quality_rules": [
|
|
171
|
+
"Relative position explicitly stated (same row/next row/below/above)",
|
|
172
|
+
"Component sizes with exact values (iconSize prop or px)",
|
|
173
|
+
"Spacing values defined (gap=\"$3\", mx=\"$2\")",
|
|
174
|
+
"Before/After visual comparison included",
|
|
175
|
+
"Success criteria are executable (verify by reading code)",
|
|
176
|
+
"Mobile vs desktop differences explicitly called out"
|
|
177
|
+
],
|
|
178
|
+
"target_skills": ["prd-planner", "architecting-solutions"]
|
|
179
|
+
},
|
|
180
|
+
"reuse_existing_infrastructure": {
|
|
181
|
+
"id": "pat-2025-01-11-007",
|
|
182
|
+
"name": "Reuse Existing Infrastructure",
|
|
183
|
+
"source": "comparison_analysis",
|
|
184
|
+
"confidence": 0.90,
|
|
185
|
+
"applications": 0,
|
|
186
|
+
"created": "2025-01-11",
|
|
187
|
+
"category": "architecture",
|
|
188
|
+
"pattern": "Always check if Context/Provider already has the data before adding new fetching",
|
|
189
|
+
"problem": "Adding duplicate data fetching creates redundant network calls and complexity",
|
|
190
|
+
"solution": {
|
|
191
|
+
"anti_pattern": "const { pendingTxs } = useBorrowTxUpdate({ accountId, networkId, provider }); // Creates new polling loop!",
|
|
192
|
+
"pattern": "const { pendingTxs } = useBorrowContext(); // BorrowDataGate already updates this"
|
|
193
|
+
},
|
|
194
|
+
"quality_checklist": [
|
|
195
|
+
"Check if Context/Provider already has the data",
|
|
196
|
+
"Verify no duplicate polling/fetching",
|
|
197
|
+
"Confirm single source of truth",
|
|
198
|
+
"Only add new fetching when lifecycle is truly independent"
|
|
199
|
+
],
|
|
200
|
+
"benefits": ["Reduces network/background calls", "Better performance (no redundant work)", "Single source of truth", "Simpler code (fewer hooks to manage)"],
|
|
201
|
+
"target_skills": ["architecting-solutions", "api-designer", "debugger"]
|
|
202
|
+
},
|
|
203
|
+
"click_time_vs_open_time_computation": {
|
|
204
|
+
"id": "pat-2025-01-11-008",
|
|
205
|
+
"name": "Click-Time vs Open-Time Computation",
|
|
206
|
+
"source": "implementation_review",
|
|
207
|
+
"confidence": 0.85,
|
|
208
|
+
"applications": 0,
|
|
209
|
+
"created": "2025-01-11",
|
|
210
|
+
"category": "react_patterns",
|
|
211
|
+
"pattern": "For mutable state, compute at action time, not at render/init time",
|
|
212
|
+
"problem": "Open-time computation creates stale snapshots when state changes before user acts",
|
|
213
|
+
"solution": {
|
|
214
|
+
"anti_pattern": "const allIds = useMemo(() =>\n claimableItems.filter(i => !pendingClaimIds.includes(i.id)),\n [claimableItems, pendingClaimIds]\n); // Stale if pendingClaimIds changes before user clicks",
|
|
215
|
+
"pattern": "onClaimAll: (ids: string[]) => Promise<void> => {\n const freshIds = claimableItems\n .filter(i => !pendingClaimIds.includes(i.id))\n .map(i => i.id);\n return submitClaim(freshIds);\n}"
|
|
216
|
+
},
|
|
217
|
+
"decision_matrix": {
|
|
218
|
+
"open_time": ["Immutable data", "Expensive computation"],
|
|
219
|
+
"click_time": ["Mutable state", "User-dependent filters"]
|
|
220
|
+
},
|
|
221
|
+
"benefits": ["State is always fresh when user acts", "No stale data issues", "Simpler reasoning about state"],
|
|
222
|
+
"target_skills": ["debugger", "api-designer"]
|
|
223
|
+
},
|
|
224
|
+
"search_before_creating_components": {
|
|
225
|
+
"id": "pat-2025-01-11-009",
|
|
226
|
+
"name": "Search Before Creating Components",
|
|
227
|
+
"source": "prud_correction",
|
|
228
|
+
"confidence": 0.90,
|
|
229
|
+
"applications": 0,
|
|
230
|
+
"created": "2025-01-11",
|
|
231
|
+
"category": "development",
|
|
232
|
+
"pattern": "ALWAYS search existing codebase before proposing new components/types",
|
|
233
|
+
"problem": "Creating duplicate components creates maintenance burden and UI inconsistency",
|
|
234
|
+
"solution": {
|
|
235
|
+
"pre_prd_search": [
|
|
236
|
+
"grep -r \"Alert\" packages/kit/src/views/ --include=\"*.tsx\"",
|
|
237
|
+
"grep -r \"IAlert\\|Alert\" packages/shared/types/ --include=\"*.ts\"",
|
|
238
|
+
"If found, read existing implementation"
|
|
239
|
+
],
|
|
240
|
+
"decision_matrix": {
|
|
241
|
+
"existing_component_matches_ui": "Reuse",
|
|
242
|
+
"existing_component_needs_small_tweak": "Extend or wrap",
|
|
243
|
+
"existing_component_has_wrong_responsibilities": "Create new",
|
|
244
|
+
"not_sure": "Reuse first"
|
|
245
|
+
}
|
|
246
|
+
},
|
|
247
|
+
"impact": {
|
|
248
|
+
"duplicate_component": "Over-engineering, UI inconsistency",
|
|
249
|
+
"reuse": "Faster implementation, shared improvements"
|
|
250
|
+
},
|
|
251
|
+
"target_skills": ["prd-planner", "architecting-solutions", "api-designer"]
|
|
252
|
+
},
|
|
253
|
+
"spacing_and_divider_debugging": {
|
|
254
|
+
"id": "pat-2025-01-11-010",
|
|
255
|
+
"name": "Spacing and Divider Debugging",
|
|
256
|
+
"source": "bug_analysis",
|
|
257
|
+
"confidence": 0.85,
|
|
258
|
+
"applications": 0,
|
|
259
|
+
"created": "2025-01-11",
|
|
260
|
+
"category": "debugging",
|
|
261
|
+
"pattern": "When debugging spacing/divider issues, audit all spacing values systematically",
|
|
262
|
+
"problem": "Component spacing (mt, mb, py, padding) can create unintended visual separators that appear as extra lines",
|
|
263
|
+
"solution": {
|
|
264
|
+
"debugging_steps": [
|
|
265
|
+
"Search for spacing-related props in components",
|
|
266
|
+
"Check for StyleSheet.hairlineWidth usage (may render differently per platform)",
|
|
267
|
+
"Compare components that work vs components that have issues",
|
|
268
|
+
"Draw component structure to identify spacing conflicts"
|
|
269
|
+
],
|
|
270
|
+
"audit_template": "| Element | Before | After | Unit | Notes |\\n|---------|--------|-------|------|-------|\\n| Trigger padding | `py=\"$3\"` | - | 12px | Accordion.Trigger |\\n| Header top margin | `mt=\"$3\"` | `mt=\"$0\"` | 12px → 0px | Remove this |"
|
|
271
|
+
},
|
|
272
|
+
"quality_rules": [
|
|
273
|
+
"Include ASCII diagram showing component structure",
|
|
274
|
+
"List exact spacing values with pixel conversions ($3 = 12px, $5 = 20px)",
|
|
275
|
+
"Compare working vs broken components",
|
|
276
|
+
"Note platform-specific behaviors (hairlineWidth varies)",
|
|
277
|
+
"Verify fix on all platforms (iOS, Android, Desktop, Web)"
|
|
278
|
+
],
|
|
279
|
+
"target_skills": ["debugger"]
|
|
280
|
+
}
|
|
281
|
+
},
|
|
282
|
+
"meta": {
|
|
283
|
+
"version": "1.0.0",
|
|
284
|
+
"last_updated": "2025-01-12",
|
|
285
|
+
"total_patterns": 10,
|
|
286
|
+
"categories": ["prd_structure", "prd_quality", "react_patterns", "async_patterns", "ui_patterns", "architecture", "development", "debugging"]
|
|
287
|
+
}
|
|
288
|
+
}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
# Appendix
|
|
2
|
+
|
|
3
|
+
## Self-Validation
|
|
4
|
+
|
|
5
|
+
### Validation Report Template
|
|
6
|
+
|
|
7
|
+
```markdown
|
|
8
|
+
## Validation Report Template
|
|
9
|
+
|
|
10
|
+
**Date**: [YYYY-MM-DD]
|
|
11
|
+
**Scope**: [skill(s) validated]
|
|
12
|
+
|
|
13
|
+
### Checks
|
|
14
|
+
- [ ] Examples compile or run
|
|
15
|
+
- [ ] Checklists match current repo conventions
|
|
16
|
+
- [ ] External references still valid
|
|
17
|
+
- [ ] No duplicated or conflicting guidance
|
|
18
|
+
|
|
19
|
+
### Findings
|
|
20
|
+
- [Finding 1]
|
|
21
|
+
- [Finding 2]
|
|
22
|
+
|
|
23
|
+
### Actions
|
|
24
|
+
- [Action 1]
|
|
25
|
+
- [Action 2]
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Memory File Structure
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
~/.claude/memory/
|
|
32
|
+
├── semantic/
|
|
33
|
+
│ └── patterns.json
|
|
34
|
+
├── episodic/
|
|
35
|
+
│ ├── 2025/
|
|
36
|
+
│ │ ├── 2025-01-11-prd-creation.json
|
|
37
|
+
│ │ └── 2025-01-11-debug-session.json
|
|
38
|
+
│ └── episodes.json
|
|
39
|
+
├── working/
|
|
40
|
+
│ ├── current_session.json
|
|
41
|
+
│ ├── last_error.json
|
|
42
|
+
│ └── session_end.json
|
|
43
|
+
└── index.json
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Automatic Workflow Integration
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
Any Skill Run
|
|
50
|
+
-> workflow-orchestrator
|
|
51
|
+
-> self-improving-agent (background)
|
|
52
|
+
-> create-pr (ask_first)
|
|
53
|
+
-> session-logger (auto)
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Continuous Learning Metrics
|
|
57
|
+
|
|
58
|
+
```json
|
|
59
|
+
{
|
|
60
|
+
"metrics": {
|
|
61
|
+
"patterns_learned": 47,
|
|
62
|
+
"patterns_applied": 238,
|
|
63
|
+
"skills_updated": 12,
|
|
64
|
+
"avg_confidence": 0.87,
|
|
65
|
+
"user_satisfaction_trend": "improving",
|
|
66
|
+
"error_rate_reduction": "-35%",
|
|
67
|
+
"self_corrections": 8
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Human-in-the-Loop
|
|
73
|
+
|
|
74
|
+
### Feedback Collection
|
|
75
|
+
|
|
76
|
+
```markdown
|
|
77
|
+
## Self-Improvement Summary
|
|
78
|
+
|
|
79
|
+
I've learned from our session and updated:
|
|
80
|
+
|
|
81
|
+
### Updated Skills
|
|
82
|
+
- `debugger`: Added callback verification pattern
|
|
83
|
+
- `prd-planner`: Enhanced UI/UX specification requirements
|
|
84
|
+
|
|
85
|
+
### Patterns Extracted
|
|
86
|
+
1. **state_monitoring_over_callbacks**: Use usePrevious for state-driven side effects
|
|
87
|
+
2. **ui_ux_specification_granularity**: Explicit visual specs prevent rework
|
|
88
|
+
|
|
89
|
+
### Confidence Levels
|
|
90
|
+
- New patterns: 0.85 (needs validation)
|
|
91
|
+
- Reinforced patterns: 0.95 (well-established)
|
|
92
|
+
|
|
93
|
+
### Your Feedback
|
|
94
|
+
Rate these improvements (1-10):
|
|
95
|
+
- Were the updates helpful?
|
|
96
|
+
- Should I apply this pattern more broadly?
|
|
97
|
+
- Any corrections needed?
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### Feedback Integration
|
|
101
|
+
|
|
102
|
+
```yaml
|
|
103
|
+
User Feedback:
|
|
104
|
+
positive (rating >= 7):
|
|
105
|
+
action: Increase pattern confidence
|
|
106
|
+
scope: Expand to related skills
|
|
107
|
+
|
|
108
|
+
neutral (rating 4-6):
|
|
109
|
+
action: Keep pattern, gather more data
|
|
110
|
+
scope: Current skill only
|
|
111
|
+
|
|
112
|
+
negative (rating <= 3):
|
|
113
|
+
action: Decrease confidence, revise pattern
|
|
114
|
+
scope: Remove from active patterns
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## Templates
|
|
118
|
+
|
|
119
|
+
| Template | Purpose |
|
|
120
|
+
|----------|---------|
|
|
121
|
+
| `templates/pattern-template.md` | Adding new patterns |
|
|
122
|
+
| `templates/correction-template.md` | Fixing incorrect guidance |
|
|
123
|
+
| `templates/validation-template.md` | Validating skill accuracy |
|
|
124
|
+
|
|
125
|
+
## References
|
|
126
|
+
|
|
127
|
+
- [SimpleMem: Efficient Lifelong Memory for LLM Agents](https://arxiv.org/html/2601.02553v1)
|
|
128
|
+
- [A Survey on the Memory Mechanism of Large Language Model Agents](https://dl.acm.org/doi/10.1145/3748302)
|
|
129
|
+
- [Lifelong Learning of LLM based Agents](https://arxiv.org/html/2501.07278v1)
|
|
130
|
+
- [Evo-Memory: DeepMind's Benchmark](https://shothota.medium.com/evo-memory-deepminds-new-benchmark)
|
|
131
|
+
- [Let's Build a Self-Improving AI Agent](https://medium.com/@nomannayeem/lets-build-a-self-improving-ai-agent-that-learns-from-your-feedback-722d2ce9c2d9)
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Session Logger
|
|
2
|
+
|
|
3
|
+
Automatically saves conversation history to persistent session log files.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
Session Logger captures your conversations with Claude Code so you can:
|
|
8
|
+
- Reference previous decisions and context
|
|
9
|
+
- Maintain continuity across sessions
|
|
10
|
+
- Learn from past problem-solving approaches
|
|
11
|
+
- Track project evolution
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
# Create symbolic link to global skills directory
|
|
17
|
+
ln -s ~/Documents/code/GitHub/agent-playbook/skills/session-logger/SKILL.md ~/.claude/skills/session-logger.md
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
Simply say:
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
"保存对话信息"
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
The skill will automatically:
|
|
29
|
+
1. Review the conversation
|
|
30
|
+
2. Extract key information
|
|
31
|
+
3. Create a session log in `sessions/`
|
|
32
|
+
|
|
33
|
+
## Trigger Phrases
|
|
34
|
+
|
|
35
|
+
| 中文 | English |
|
|
36
|
+
|------|---------|
|
|
37
|
+
| 保存对话信息 | save session |
|
|
38
|
+
| 保存本次对话 | save conversation |
|
|
39
|
+
| 记录会话内容 | log session |
|
|
40
|
+
| 保存session | save this session |
|
|
41
|
+
|
|
42
|
+
## Session File Location
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
sessions/YYYY-MM-DD-{topic}.md
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Privacy
|
|
49
|
+
|
|
50
|
+
Session logs are in `.gitignore` - they are NOT committed to git.
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: session-logger
|
|
3
|
+
description: Saves conversation history to session log files. Use when user says "保存对话", "保存对话信息", "记录会话", "save session", or "save conversation". Automatically creates timestamped session log in sessions/ directory.
|
|
4
|
+
allowed-tools: Read, Write, Edit, Bash
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Session Logger
|
|
8
|
+
|
|
9
|
+
A skill for automatically saving conversation history to persistent session log files.
|
|
10
|
+
|
|
11
|
+
## When This Skill Activates
|
|
12
|
+
|
|
13
|
+
This skill activates when you:
|
|
14
|
+
- Say "保存对话信息" or "保存对话"
|
|
15
|
+
- Say "记录会话内容" or "保存session"
|
|
16
|
+
- Say "save session" or "save conversation"
|
|
17
|
+
- Ask to save the current conversation
|
|
18
|
+
|
|
19
|
+
## Session File Location
|
|
20
|
+
|
|
21
|
+
All sessions are saved to: `sessions/YYYY-MM-DD-{topic}.md`
|
|
22
|
+
|
|
23
|
+
## What Gets Logged
|
|
24
|
+
|
|
25
|
+
For each session, log:
|
|
26
|
+
|
|
27
|
+
1. **Metadata**
|
|
28
|
+
- Date and duration
|
|
29
|
+
- Context/working directory
|
|
30
|
+
- Main topic
|
|
31
|
+
|
|
32
|
+
2. **Summary**
|
|
33
|
+
- What was accomplished
|
|
34
|
+
- Key decisions made
|
|
35
|
+
- Files created/modified
|
|
36
|
+
|
|
37
|
+
3. **Actions Taken**
|
|
38
|
+
- Checklist of completed tasks
|
|
39
|
+
- Pending follow-ups
|
|
40
|
+
|
|
41
|
+
4. **Technical Notes**
|
|
42
|
+
- Important code snippets
|
|
43
|
+
- Commands used
|
|
44
|
+
- Solutions found
|
|
45
|
+
|
|
46
|
+
5. **Open Questions**
|
|
47
|
+
- Issues to revisit
|
|
48
|
+
- Follow-up tasks
|
|
49
|
+
|
|
50
|
+
## Session Template
|
|
51
|
+
|
|
52
|
+
```markdown
|
|
53
|
+
# Session: {Topic}
|
|
54
|
+
|
|
55
|
+
**Date**: {YYYY-MM-DD}
|
|
56
|
+
**Duration**: {approximate}
|
|
57
|
+
**Context**: {project/directory}
|
|
58
|
+
|
|
59
|
+
## Summary
|
|
60
|
+
|
|
61
|
+
{What was accomplished in this session}
|
|
62
|
+
|
|
63
|
+
## Key Decisions
|
|
64
|
+
|
|
65
|
+
1. {Decision 1}
|
|
66
|
+
2. {Decision 2}
|
|
67
|
+
|
|
68
|
+
## Actions Taken
|
|
69
|
+
|
|
70
|
+
- [x] {Completed action 1}
|
|
71
|
+
- [x] {Completed action 2}
|
|
72
|
+
- [ ] {Pending action 3}
|
|
73
|
+
|
|
74
|
+
## Technical Notes
|
|
75
|
+
|
|
76
|
+
{Important technical details}
|
|
77
|
+
|
|
78
|
+
## Open Questions / Follow-ups
|
|
79
|
+
|
|
80
|
+
- {Question 1}
|
|
81
|
+
- {Question 2}
|
|
82
|
+
|
|
83
|
+
## Related Files
|
|
84
|
+
|
|
85
|
+
- `{file-path}` - {what changed}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## How to Use
|
|
89
|
+
|
|
90
|
+
### Option 1: Automatic Logging
|
|
91
|
+
|
|
92
|
+
Simply say:
|
|
93
|
+
```
|
|
94
|
+
"保存对话信息"
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
The skill will:
|
|
98
|
+
1. Review the conversation history
|
|
99
|
+
2. Extract key information
|
|
100
|
+
3. Create/update the session file
|
|
101
|
+
|
|
102
|
+
### Option 2: With Topic
|
|
103
|
+
|
|
104
|
+
Specify the session topic:
|
|
105
|
+
```
|
|
106
|
+
"保存对话,主题是 skill-router 创建"
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Option 3: Manual Prompt
|
|
110
|
+
|
|
111
|
+
If auto-extraction misses something, provide details:
|
|
112
|
+
```
|
|
113
|
+
"保存对话,重点是:1) 创建了 skill-router,2) 修复了 front matter"
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## File Naming
|
|
117
|
+
|
|
118
|
+
| Input | Filename |
|
|
119
|
+
|-------|----------|
|
|
120
|
+
| "保存对话" | `YYYY-MM-DD-session.md` |
|
|
121
|
+
| "保存对话,主题是 prd" | `YYYY-MM-DD-prd.md` |
|
|
122
|
+
| "保存今天的讨论" | `YYYY-MM-DD-discussion.md` |
|
|
123
|
+
|
|
124
|
+
## Session Log Structure
|
|
125
|
+
|
|
126
|
+
```
|
|
127
|
+
sessions/
|
|
128
|
+
├── README.md # This file
|
|
129
|
+
├── 2025-01-11-skill-router.md # Session about skill-router
|
|
130
|
+
├── 2025-01-11-prd-planner.md # Session about PRD planner
|
|
131
|
+
└── 2025-01-12-refactoring.md # Session about refactoring
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
## Privacy Note
|
|
135
|
+
|
|
136
|
+
Session logs are stored in `sessions/` which is in `.gitignore`.
|
|
137
|
+
- Logs are NOT committed to git
|
|
138
|
+
- Logs contain your actual conversation
|
|
139
|
+
- Safe to include sensitive information
|
|
140
|
+
|
|
141
|
+
## Quick Reference
|
|
142
|
+
|
|
143
|
+
| You say | Skill does |
|
|
144
|
+
|---------|------------|
|
|
145
|
+
| "保存对话信息" | Creates session log with today's date |
|
|
146
|
+
| "保存今天的对话" | Creates session log |
|
|
147
|
+
| "保存session" | Creates session log |
|
|
148
|
+
| "记录会话" | Creates session log |
|
|
149
|
+
|
|
150
|
+
## Best Practices
|
|
151
|
+
|
|
152
|
+
1. **Save at key milestones**: After completing a feature, fixing a bug, etc.
|
|
153
|
+
2. **Be specific with topics**: Helps when searching later
|
|
154
|
+
3. **Include code snippets**: Save important solutions
|
|
155
|
+
4. **Track decisions**: Why did you choose X over Y?
|
|
156
|
+
5. **List pending items**: What to do next time
|