Loading...
Loading...
Use when extracting imperatives from agent instruction files, analyzing rule coverage, or preparing input for /policy-algebra and /distill.
npx skill4agent add camacho/ai-skills imperatives/imperatives # default: ai-workspace/rules/*.md + AGENTS.md
/imperatives .claude/rules/*.md # specific globs
/imperatives --output imperatives.jsonl # write to fileai-workspace/rules/*.mdAGENTS.mdnode --import tsx scripts/extract-imperatives.ts <files...> --output /tmp/imperatives-pass1.jsonlRead. Here are the imperatives already extracted by the script for this file:<file><pass 1 JSONL lines where source.file matches>Identify additional imperative statements the regex missed. Look for:
- Implicit obligations hidden in prose (e.g., "The workflow is a menu, not a pipeline" implies MUST NOT enforce order)
- Contextual constraints (e.g., section context that makes a statement imperative)
- Conditional rules not triggered by keyword patterns
For each new imperative found, output one JSON line (same schema — id, level, polarity, subject, predicate, when, source, tool_scope, tags, raw). Do NOT duplicate entries already in pass 1. If none found, output nothing.
subagent_type: "explorer"raw--output <path>leveltool_scope/policy-algebra/distill| Condition | Behavior |
|---|---|
| No files matched | Error message. Stop. |
| File not found | Script warns on stderr, continues with remaining files. |
| Zero imperatives | Report zero. Not an error. |
| Script exits non-zero | Surface stderr to user. |