.claude/skills/rag-knowledge-capture-cli/SKILL.md
Generate RAG-optimized knowledge chunks from a Claude Code CLI session (VS Code). Integrated with CLAUDE.md Session End Protocol — auto-triggered before /clear. Produces chunked Markdown files with Qdrant-ready frontmatter metadata. Qdrant collection: "knowledge". Chunk strategy: split per problem-solution pair. Output language: English only (optimized for embedding quality). Saves to .claude/summaries/ and signals push-to-qdrant.sh. NEVER push to any API. ONLY output .md files.
npx skillsauth add figulazmi/token-monitor rag-knowledge-capture-cliInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Convert a Claude Code CLI session into RAG-optimized, independently embeddable knowledge chunks. Designed to integrate with the CLAUDE.md Session End Protocol.
Each chunk must be semantically rich and self-contained — Qdrant embeds each chunk independently. Poor context = poor retrieval.
This skill is the implementation of Step 1 in the Session End Protocol:
## Session End Protocol
Before ending any session or using /clear, always:
1. ← THIS SKILL handles this step
Run: summarize this session as a knowledge document
2. Save to: .claude/summaries/YYYY-MM-DD-[topic].md
3. Run: bash ~/scripts/push-to-qdrant.sh .claude/summaries/[file]
# Step 2: Save (Claude Code CLI can do this directly)
# The skill will instruct Claude to save the file automatically
# Step 3: Push to Qdrant
bash ~/scripts/push-to-qdrant.sh .claude/summaries/YYYY-MM-DD-[topic].md
Trigger automatically when:
/clear → run this BEFORE clearingAlso trigger on demand:
After generating the knowledge document, Claude Code CLI MUST:
Determine filename: YYYY-MM-DD-[slug-topic].md
2026-04-06-iis-ssl-binding-fix.mdSave file to: .claude/summaries/[filename]
mkdir -p .claude/summariesPrint confirmation and push command:
✅ Knowledge chunk saved: .claude/summaries/2026-04-06-[topic].md
📦 Push to Qdrant (menggunakan Git Bash bukan PowerShell):
bash ~/scripts/push-to-qdrant.sh .claude/summaries/2026-04-06-[topic].md
DEFAULT: CHUNKED
## CHUNK blocks inside one file---
id: [YYYY-MM-DD]-[slug-topic]
date: YYYY-MM-DD
source: claude-code-cli
project: [project name] # petrochina-eproc | homelab | mit-internal
topic: [concise topic title]
tags: [tag1, tag2, tag3] # lowercase, hyphenated, max 8 tags
related: [topic-1, topic-2]
session_type: [debug|feature|setup|refactor|architecture|research]
environment: [dev|uat|prod|homelab]
git_branch: [branch name if applicable]
status: implemented # REQUIRED: implemented | planned
chunk_source: code # REQUIRED: code | design
---
implemented — code is deployed or merged; Claude retrieves this by defaultplanned — architecture design, roadmap, future feature; Claude skips this by default (requires include_planned=true)plannedcode — describes actual code, configuration, or deployed infrastructuredesign — architecture decision, design doc, flow diagram, roadmapfeature/vendor-auth-fix, uat, mainLANGUAGE LOCK — ENFORCED AT TEMPLATE LEVEL ALL content in every chunk field MUST be written in English. This includes: Context, Problem, Solution, Key Facts, Caveats — every word. Bahasa Indonesia is PROHIBITED. Writing in Indonesian = embedding quality degraded = retrieval broken. If you catch yourself writing Indonesian inside a chunk: stop, translate, continue.
## CHUNK [N]: [Chunk Title]
### Context
[English only. 1–3 sentences. What system, what goal, what constraint?
Must be self-contained — readable without seeing other chunks.]
### Problem
[English only. Specific issue, question, or challenge. Include error messages or symptoms.]
### Solution
[English only. Actual fix, decision, or answer. Include key reasoning. This is retrieval core.]
### Key Facts
[English only. Atomic, independently searchable facts. Minimum 3.]
- Fact 1
- Fact 2
- Fact 3
### Code / Commands
[ONLY if essential. Keep concise.]
\```language
code here
\```
### Caveats
[English only. ONLY if there are important gotchas or conditions.]
PRIMARY RULE: one distinct problem = one chunk
Split new chunk when:
Merge into one chunk when:
---
## SESSION METADATA
- **Total chunks**: [N]
- **Qdrant collection**: knowledge
- **Primary project**: [project]
- **Stack involved**: [technologies used]
- **Files modified**: [list key files if applicable]
- **Git branch**: [branch if applicable]
- **Unresolved items**: [open questions or next steps]
- **Author**: Figur Ulul Azmi
- **Generated by**: Claude Code CLI — RAG Knowledge Capture Skill
collection: knowledge note in SESSION METADATAIf user types /clear without running Session End Protocol first:
→ STOP the clear action → Say: "⚠️ Session End Protocol belum dijalankan. Jalankan RAG capture dulu?" → Wait for user confirmation → If confirmed: run this skill first, then allow /clear → If skipped: allow /clear but warn that session knowledge will be lost
---
id: 2026-04-06-hangfire-jde-sync-failure
date: 2026-04-06
source: claude-code-cli
project: petrochina-eproc
topic: Hangfire JDE Sync Intermittent Failure Debug
tags: [hangfire, jde-sync, ef-core, bulk-extensions, petrochina, eproc, debug, fixed]
related: [jde-integration, employee-sync, department-sync]
session_type: debug
environment: dev
git_branch: feature/jde-sync-fix
---
## CHUNK 1: Hangfire Job Completes Without Error But Data Not Updated
### Context
PetroChina Eproc uses Hangfire cron job (03:00 WIB) to sync employee and department
data from JDE via SyncJdeDataHandler. Job runs in D2 domain using MediatR dispatch
and BulkSyncAsync (TRUNCATE + BulkInsert + transaction).
### Problem
Job status shows "Succeeded" in Hangfire dashboard but target DB tables not updated.
No exceptions thrown. Issue intermittent — occurs roughly 2–3x per week in dev env.
CPU and memory normal. SQL Server connections not spiking.
### Solution
Root cause: missing [JsonPropertyName] attributes on JDE API response DTOs.
System.Text.Json silently ignores unmapped properties — deserialization returns
default/null values. BulkInsert then writes nulls, overwriting valid data.
Fix: add explicit [JsonPropertyName] on all JDE DTO properties matching API response
field names exactly (case-sensitive).
### Key Facts
- System.Text.Json default behavior: silently skips unknown JSON properties, no exception
- Missing [JsonPropertyName] causes silent null deserialization — no error thrown
- BulkSyncAsync uses TRUNCATE before insert — null data overwrites valid records
- Hangfire marks job "Succeeded" regardless of data correctness if no exception thrown
- Fix: [JsonPropertyName("employeeCode")] must match JDE API response field name exactly
### Code / Commands
```csharp
// Before (broken — silent null)
public string EmployeeCode { get; set; }
// After (fixed)
[JsonPropertyName("employeeCode")]
public string EmployeeCode { get; set; }
```
Null-to-empty mapping gaps also found — some nullable JDE fields mapped to non-nullable DB columns. Add null coalescing in mapping layer, not in DTO.
Same sync session. After fixing JsonPropertyName, discovered a second issue: SyncJdeDataHandler was calling a repository from D1 (read domain) inside D2 (write domain) sync handler — violating Clean Architecture domain isolation.
D2 SyncDepartmentDataAsync calling D1 DepartmentReadRepository to check existing records before insert. This created a cross-domain dependency and broke CQRS read/write separation.
Removed cross-domain repository call. BulkSyncAsync already handles existence check implicitly via TRUNCATE + full re-insert pattern. No pre-check needed. If selective upsert needed in future: use BulkExtensions BulkMerge, not manual check.
✅ Knowledge chunk saved: .claude/summaries/2026-04-06-hangfire-jde-sync-failure.md
📦 Push to Qdrant:
bash ~/scripts/push-to-qdrant.sh .claude/summaries/2026-04-06-hangfire-jde-sync-failure.md
development
Web application security testing workflow for OWASP Top 10 vulnerabilities including injection, XSS, authentication flaws, and access control issues.
development
To build powerful frontend claude.ai artifacts, follow these steps:
tools
Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.
testing
应用安全专家,专注于认证授权、数据保护和合规性审计。当用户需要:(1) 设计安全的登录认证系统 (2) 进行安全代码审查 (3) 检查 GDPR/隐私合规 (4) 防范常见安全漏洞 (OWASP Top 10) 时使用此 Skill。