policy-qa
Answer policy questions with strict citations. Refuses to answer without sources.
npx skills add majiayu000/claude-skill-registry --skill policy-qa --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Policy Q&A Skill ## Purpose Answer policy and SOP questions with strict source attribution. Refuses to answer without relevant sources. Designed for compliance-sensitive environments. ## Usage ```python # Ask policy question answer = policy_qa( question="What is the approval workflow for journal entries over $100K?", top_k=5, min_confidence=0.8 ) ``` ## Workflow ### 1. Embed Question ```python from sentence_transformers import SentenceTransformer def embed_question(question, model_name='sentence-transformers/all-MiniLM-L6-v2'): """Embed question using same model as policy corpus""" model = SentenceTransformer(model_name) embedding = model.encode(question) return embedding.tolist() ``` ### 2. Retrieve from pgvector ```python import psycopg2 def retrieve_policy_sources(question_embedding, top_k=5): """Retrieve similar policy chunks from pgvector""" conn = psycopg2.connect(os.environ['POSTGRES_URL']) cursor = conn.cursor() # Vector similarity search query = """ SELECT id, text, document_name, section, page_number, url, 1 - (embedding <=> %s::vector) AS similarity FROM policy_chunks WHERE 1 - (embedding <=> %s::vector) > 0.3 -- Minimum similarity threshold ORDER BY embedding <=> %s::
- Purpose
- Usage
- Workflow
- 1. Embed Question
- 2. Retrieve from pgvector
- 3. Rank by Relevance
- 4. Check Confidence Threshold
- 5. Generate Answer with Citations
- 6. Format Response with Sources
- 7. Audit Logging
- Full Workflow Example
- Evaluation
- Policy Corpus Ingestion
- Schema
What does the policy-qa skill do?
Answer policy questions with strict citations. Refuses to answer without sources.
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill policy-qa --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
