一键导入
dot-prime
// Activate principles before working on a file or task. Supports explicit group and ID overrides. Use when the user runs /dot-prime [target] to load the relevant principles into the active frame before writing or editing.
// Activate principles before working on a file or task. Supports explicit group and ID overrides. Use when the user runs /dot-prime [target] to load the relevant principles into the active frame before writing or editing.
| name | dot-prime |
| description | Activate principles before working on a file or task. Supports explicit group and ID overrides. Use when the user runs /dot-prime [target] to load the relevant principles into the active frame before writing or editing. |
| argument-hint | [@group...] [ID...] | [file|directory|description] |
| allowed-tools | Read, Glob, Grep, Bash |
| version | 0.12.0 |
| authors | Flemming N. Larsen (https://github.com/flemming-n-larsen) |
| license | MIT |
| generated-by | .principles |
⛔ PREREQUISITE — CHECK THIS BEFORE ANYTHING ELSE
Before parsing arguments or doing any work, determine whether an explicit principle spec is present in
$ARGUMENTS:
- Explicit spec =
$ARGUMENTScontains one or more@-prefixed tokens, or tokens matching[A-Z][A-Z0-9]*(-[A-Z0-9]+)+(bare principle IDs likeCODE-CS-DRY)If no explicit spec is present, check for principle sources in this order:
Read
.agents/principles-catalog/active.md; keep if it contains the generated-by marker (<!-- generated by /dot-scout). If found, continue.If none found: glob
.github/instructions/*.instructions.mdandREVIEW.md(at the git root) — these are Copilot Code Review and Claude Code Review outputs; keep only files containing the generated-by marker. If any are found, continue.If none found: walk up from the target path (or CWD when no path was given) to the git root (
.git/), max 10 levels; collect any.principlesfiles. If any are found, continue.If nothing is found → STOP. Do not proceed. Respond only with:
⚠️
/dot-primefound no principle sources. Run/dot-scoutto generate instruction files, or create a.principlesfile listing@grouptags, then retry.
You are activating a compact set of principles before working on a file or task. Follow these four phases exactly.
Scan $ARGUMENTS for explicit principle specs:
@<group> tokens — one or more words prefixed with @ (e.g. @ddd, @docs-as-code). Extract all such tokens as the spec; the remaining tokens form the target context.[A-Z][A-Z0-9]*(-[A-Z0-9]+)+ (e.g. CODE-CS-DRY, SOLID-SRP). Extract all matching tokens as the spec; remaining tokens form the target context.$ARGUMENTS as target context. This is normal mode.If a spec was detected: set explicit-mode: true. Otherwise: explicit-mode: false.
Determine the artifact type from the target context (remaining tokens after spec extraction, or the full $ARGUMENTS in normal mode). If the target context is empty or a description rather than a path, scan the current working directory.
Detect by reading .agents/principles-catalog/layers/artifact-types.yaml and matching extensions, filenames, and path patterns.
Record the detected type: code | docs | config | infra | schema | pipeline
For code targets, also note any risk signals present: authentication, payments, PII, public API, concurrency, high-throughput.
For each @<group> token: read .agents/principles-catalog/groups/<group>.yaml. Add all IDs from its principles: list. Recursively process any includes: entries (detect cycles and abort). If a group file is not found, report a warning and continue.
For each bare principle ID token: add it directly to the active set.
Active set = union of all expanded IDs.
Read the active principle set from the first source found:
.agents/principles-catalog/active.md — written by /dot-scout Phase 6 on every run; present whenever the catalog is vendored. Check for the <!-- generated by /dot-scout marker.active.md is absent): glob .github/instructions/*.instructions.md and REVIEW.md at the git root (Copilot Code Review and Claude Code Review outputs respectively); filter to files containing the generated-by marker..principles hierarchy (fallback — only if no scout-generated files found at all): handled below.For sources 1 and 2: parse every - ID: Summary line; the ID is everything before the first colon. Union all IDs → active set.
Fallback — .principles hierarchy: if no scout-generated files were found in steps 1–3:
Walk up from the target path (determined in Phase 1) or CWD if no path was given, to the git root (.git/), max 10 levels. Collect every .principles file encountered. Order them root → target.
For each file (root → target):
# comment lines.:directive value — parse as a configuration directive; :max_principles N caps the active set to N after all files are processed.@group — read .agents/principles-catalog/groups/<group>.yaml; add all IDs from its principles: list to the active set; recursively expand any includes: entries (detect and abort on cycles).ID matching [A-Z][A-Z0-9]*(-[A-Z0-9]+)+ (case-insensitive) — add to the active set.!ID — add to the exclusion set.active set = collected IDs MINUS exclusion set (then apply :max_principles cap if set).
Note in the output: (resolved from .principles — no scout-generated files found)
If .agents/principles-catalog/install.cfg contains scout but active.md is absent, add a non-blocking warning alongside the active rules:
⚠️ Scout is recorded as installed but
.agents/principles-catalog/active.mdnot found. Consider re-running/dot-scout.
From the active set, select 5 to 10 principles most relevant to the current task. Hard cap: 10.
Selection priority (fill from top until cap reached):
OWASP-*, CODE-SEC-*, CODE-RL-*, INFRA-SEC-*, or SEC-ARCH-*, AND which match a risk signal detected in Phase 1SIMPLE-DESIGN-REVEALS-INTENTION, CODE-CS-DRY, CODE-CS-KISS, CODE-CS-YAGNI, CODE-DX-NAMING, ARCH-DECISION-RECORDSIn explicit mode, if the resolved set is ≤ 10: use all of them. If > 10: apply the same priority order to trim.
Output the selected principles as a compact block. For each principle, write a single line:
- ID: one imperative sentence summarising what to do
The imperative sentence must be ≤ 12 words, written in second-person present tense (e.g. "Give every piece of knowledge one authoritative home."). Derive it from the principle title and your knowledge of the principle — do not read any catalog files.
Format:
**Active rules:**
- CODE-CS-DRY: Give every piece of knowledge one authoritative home.
- SOLID-SRP: Give each module exactly one reason to change.
- CODE-CS-FAIL-FAST: Detect errors immediately and report them loudly.
...
End with this line, on its own:
These are your focus principles for this task. Any full rule set from
.agents/principles-catalog/active.md,REVIEW.md, or.github/instructions/remains active. Proceed.
Review a file, directory, or inline code against its activated principles. Supports explicit principle override with --with / @group / on syntax. Use when the user runs /dot-audit [target] to check code or docs against quality principles.
Analyse a project to detect which principles apply and create or update .principles files encoding that analysis. Use when the user runs /dot-scout [path] to map principles to a codebase.
Build and deploy all sample-bot zip files into the target folder. Use when the user runs /deploy-sample-bots [TARGET_DIR].