legal-harness-init

Generate and safely upsert AGENTS.md and CLAUDE.md legal collaboration baselines across AI harnesses.

636|91|Updated Jan 7, 2026
One-click install
npx skills add https://github.com/cat-xierluo/legal-skills --skill legal-harness-init
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: legal-harness-init
Source: https://github.com/cat-xierluo/legal-skills/tree/main/skills/legal-harness-init
Command: npx skills add https://github.com/cat-xierluo/legal-skills --skill legal-harness-init

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

Legal professionals repeatedly re-explain their role, workflow, and confidentiality rules to AI assistants in every new session, and AI actions often go unrecorded, making later audit and accountability impossible. This Skill turns those stable collaboration requirements into persistent, verifiable AGENTS.md/CLAUDE.md instructions.

Core Features & Use Cases

  • Harness Detection and Safe Writing: Detects 8 AI harness platforms (Claude Code, Codex, OpenClaw, MyAgents, QoderWork, QwenWork, WorkBuddy, Orca), then upserts managed marker blocks with diff preview, atomic replacement, backups, and restore support.
  • Legal Safety Baseline: Generates permission, confidentiality, traceability, and human-review contracts with three privacy modes (strict/local/team) that keep real case facts, credentials, and identity numbers out of long-term instructions.
  • Activation Verification: Distinguishes CONFIG_WRITTEN, INSTRUCTIONS_LOADED, and BEHAVIOR_VERIFIED states using new-session probes, and records harness/model/version metadata in an append-only init-environment block.
  • Use Case: A litigator starting a new case runs the quick guided mode to produce a minimal project AGENTS.md with a project codename, key deadlines, and a controlled fact entry, without exposing client details.

Quick Start

Ask the AI to initialize a legal safety baseline AGENTS.md for your current project using quick mode with strict privacy.

Frequently Asked Questions about legal-harness-init

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up AGENTS.md for legal work with Claude Code or Codex?

Run the detect script to identify installed harnesses, then use quick guided mode to answer up to five questions about role, workflow, permissions, and privacy. The Skill generates a minimal legal safety baseline and writes it via managed marker blocks with diff preview before any change lands.

What is the difference between user-level and project-level AGENTS.md?

User-level files like ~/.claude/CLAUDE.md hold cross-project stable content such as your role, workflow, and collaboration preferences. Project-level files hold per-matter context like project codename, stage, key deadlines, and controlled fact entry points.

Does it support AI harnesses other than Claude Code?

Yes, it detects eight platforms including Codex, OpenClaw, MyAgents, QoderWork, QwenWork, WorkBuddy, and Orca. Automatic writing applies only to AGENTS.md/CLAUDE.md-style platforms; non-AGENTS.md platforms are detected and reported for manual configuration.

Will it overwrite my existing AGENTS.md content?

No. It only upserts content inside paired managed marker blocks identified by stable block IDs, showing a diff first. Content outside the markers is never overwritten, deleted, or reordered, and the original file is backed up with permission and hash metadata for restore.

How does it protect client confidentiality in configuration files?

Three privacy modes control what enters long-term instructions: strict keeps only codenames and rules, local stores real facts in a 0600-permission gitignored file, and team references an organization-approved controlled repository. A validation script blocks credentials, ID numbers, and case details before writing.

Why does it report NOT_VERIFIED after writing the configuration?

Writing a file only proves CONFIG_WRITTEN, not that a new session loaded it. Harnesses build their instruction chain at session start, so verification requires launching a fresh session and passing four behavioral probes covering permission, confidentiality, information gaps, and traceability.