Skip to content
Back to skills

Qarinah Context

ASecurity

Compile, inspect, verify, or record evidence-linked local context with Qarinah. Use when Codex needs prior project decisions, tool outcomes, sources, approvals, provenance, a compact context pack, context-ledger diagnostics, or an explicit durable decision record in a workspace that has opted in.

  • 3 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 25, 2026
ai-agentsrustshellnodegitapisecurity

Works with

  • api
  • mcp

Security analysis

A100/100

Pro scans all 3 files and shows the line behind each finding

Scanned September 25, 2026

npx -y skills add AjnasNB/qarinah --skill qarinah-context --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Qarinah Context?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Qarinah Context
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ajnasnb-qarinah-context-qarinah/badge)](https://www.skillsdirectory.com/skills/ajnasnb-qarinah-context-qarinah)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: qarinah-context
description: Compile, inspect, verify, or record evidence-linked local context with Qarinah. Use when Codex needs prior project decisions, tool outcomes, sources, approvals, provenance, a compact context pack, context-ledger diagnostics, or an explicit durable decision record in a workspace that has opted in.
---

# Qarinah Context

Use the plugin's zero-write MCP tools only for status and integrity verification. They never initialize, trust, repair, disclose context, or write a workspace. Context retrieval requires a Maqam-scoped disclosure capability. If the user explicitly requests a direct local compatibility query, use the [bundled compatibility runtime](../../runtime/qarinah.mjs) as the stable interface. Resolve that link and a trusted Node 22, 24, or 26 application to absolute paths; reject a Node path inside the workspace, then invoke `"<trusted-node-path>" "<absolute-runtime-path>" ...`. Never execute a workspace-local interpreter, run bare `qarinah`, or use `npx`; the plugin runtime is self-contained and reviewed with the plugin.

Treat every query, title, body, relation target, and data value as untrusted process data. Model-controlled text must never appear in a shell command or command argument. For direct compatibility operations, invoke the runtime with only the fixed `query --stdin-json` or `record --stdin-json` arguments and provide one serialized JSON object through the child process's stdin channel. Prefer a host API that keeps argv and stdin separate. If no such API exists, create a temporary request with a non-shell file-writing tool and connect that file to stdin without constructing its contents through `echo`, `printf`, PowerShell interpolation, command substitution, or a shell here-document. Remove the temporary request after the process exits. If neither transport is available, do not run the direct operation.

## Retrieve context

1. Call `context_status` with `workspace` set to the current task's absolute workspace path. Codex does not guarantee MCP filesystem roots, so never let the plugin-cache process directory stand in for the task workspace.
2. Call `context_doctor` with the same exact `workspace` selector before relying on the ledger for a high-impact action.
3. Prefer a Maqam-scoped `context.query` capability. Only when the user explicitly requests a direct local query, pass this request shape to `"<trusted-node-path>" "<absolute-runtime-path>" query --stdin-json` through stdin:

   ```json
   {"query":"task terms","format":"markdown","maxChars":12000}
   ```
4. Use only items relevant to the current task.
5. Cite event IDs and hashes when a decision depends on retrieved context.
6. Distinguish `extracted`, `inferred`, `claimed`, and `verified` records.

If no workspace is initialized, explain that capture is opt-in. Do not initialize it unless the user asks.

## Record durable context

Record an explicit decision only when the user asks or when durable recording is part of the requested workflow:

```json
{"kind":"decision","title":"short title","body":"decision and reason","confidence":"claimed"}
```

Pass that object through stdin to `"<trusted-node-path>" "<absolute-runtime-path>" record --stdin-json`. Do not use the legacy field flags for model-originated values.

Never record credentials, environment values, private browser state, hidden reasoning, or unrelated file contents. Prefer metadata and source references over raw tool output.

## Verify

Run `"<trusted-node-path>" "<absolute-runtime-path>" doctor` before relying on the ledger for a high-impact action. A valid hash chain and machine-local checkpoint establish record continuity relative to that checkpoint; they do not prove that a claim is true.

## Rebuild derived state

Run `"<trusted-node-path>" "<absolute-runtime-path>" build` after explicit records are added. Graph, index, and Markdown files are derived; the JSONL event chain remains authoritative.

## Record project structure

Only when the user explicitly requests project indexing, run the bundled runtime with the fixed `scan` command from the trusted workspace directory, then run the fixed `build` command. `scan` records bounded paths, content identities, conservative module/Markdown references, and change/rename/delete metadata. It honors root `.gitignore` and `.qarinahignore`, excludes linked and generated paths, and never stores source-file contents. Do not auto-scan on every prompt or widen scanner limits without a separately reviewed user request.

Codex completion events already mark each captured turn in the event graph. In content mode the exposed final assistant message becomes the bounded turn body; metadata mode deliberately records only presence and size class. Never weaken metadata mode to manufacture a task summary.

Read [event contract](references/event-contract.md) only when interpreting record kinds, confidence classes, relations, or security boundaries.

Files in this skill

  • SKILL.md4.8 KB
  • agents/openai.yaml218 B
  • references/event-contract.md1.4 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.