002-write-policy

Creates conflict-checked ADR, BDR, or EDR policy documents following XDRS standards.

1|1|Updated Feb 28, 2026
One-click install
npx skills add https://github.com/flaviostutz/xdrs-core --skill 002-write-policy-flaviostutz
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: 002-write-policy
Source: https://github.com/flaviostutz/xdrs-core/tree/main/examples/typed-scope/.xdrs/_core/adrs/principles/skills/002-write-policy
Command: npx skills add https://github.com/flaviostutz/xdrs-core --skill 002-write-policy-flaviostutz

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing a new architectural, business, or engineering decision record without a consistent structure leads to duplicated decisions, scope conflicts, and documents that AI agents and humans cannot reliably discover or apply. ## Core Features & Use Cases - Guided Policy Authoring: Walks through type selection (ADR, BDR, EDR), scope placement, subject assignment, and ID numbering based on reserved 100-number blocks per subject. - Conflict and Redundancy Checking: Researches existing policies across all scopes (including extended scopes via extends: chains) to detect overlaps and contradictions before drafting. - Standards Enforcement: Applies the mandatory XDRS policy template, BCP 14 normative language, frontmatter requirements (apply-to:, valid-from:), and lint verification. - Use Case: When your team decides to standardize on a package manager, use this Skill to create a properly scoped, numbered, conflict-checked EDR policy document and register it in the scope indexes. ## Quick Start Ask the AI to create a new policy for your decision topic, for example: write a new EDR policy about the testing strategy for the application scope.

Frequently Asked Questions about 002-write-policy

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

FAQPage Schema
How do I create a new ADR, BDR, or EDR policy document?▼

Activate this Skill and provide the decision topic. It guides you through scope placement, type selection, subject assignment, and ID numbering, then drafts the policy using the mandatory XDRS template and registers it in the scope indexes.

How are policy ID numbers assigned in XDRS?▼

Each subject reserves a 100-number block (e.g., principles uses 001-100, application uses 101-200). The Skill scans existing files in the target subject directory and assigns the lowest unassigned number in the block, using the 901-999 overflow range only when the block is exhausted.

Does the Skill check for conflicts with existing policies?▼

Yes. It reads all relevant policies across active scopes, resolves any `extends:` chains depth-first, and evaluates `valid-from:` and `apply-to:` metadata to identify overlaps or contradictions before drafting. Found conflicts are documented in a mandatory Conflicts section.

What frontmatter fields are required in an XDRS policy?▼

Every policy requires `name`, `description`, `apply-to`, and `valid-from` fields. The `apply-to` field describes applicable contexts in under 40 words, and `valid-from` uses ISO YYYY-MM-DD format, defaulting to today's date when unspecified.

When should I use structured rule blocks in a policy?▼

Use structured rules when the decision defines strong requirements that other documents or agents need to cite individually. Each rule becomes a numbered heading like `01-data-must-be-encrypted-at-rest` inside the Details section, referenced via dot-notation.

Can this Skill create policies in external scopes?▼

No. It must not create documents in external scopes listed in the workspace root `.filedist.lock` file, and it keeps the scope `_local` unless the user explicitly states otherwise.