Repository organization
Keep each repository easy for humans and agents to navigate by putting durable context, reusable guidance, automation, and decisions in the right layer. Prefer the smallest durable home that will be loaded at the time it matters.
When to use
- A user asks where to put a new instruction, convention, policy, skill, command, script, workflow, reference doc, or ADR.
- A repo is accumulating scattered Markdown, duplicated agent instructions, or ad hoc decision notes.
- A change introduces a naming, layout, vendor, architecture, security, deployment, or process decision that future contributors should not re-litigate.
- A README is being created, reorganized, or reviewed for standard structure.
- A user asks whether something belongs in
AGENTS.md, .agent/context/, .agent/policy/, .agent/workflows/, skills/, docs/, scripts/, or presets/.
- A project is being bootstrapped from the darkmatter template and needs its local context filled in cleanly.
When NOT to use
- The task is specifically reorganizing Nix flakes, flake-parts outputs, NixOS modules, nix-darwin modules, or Home Manager modules. Use
nix-flake-organization.
- The user only asks to create or edit a team-wide skill. Use
dm-skill-creator; layer this skill only for placement or ADR questions around that change.
- The user is asking for one-off implementation notes that do not need to survive beyond the current task.
- The repository already has a clear local convention that conflicts with this guidance and the user explicitly wants to preserve it. Follow the local convention and note the tradeoff.
Reference repo
Refer to our living repo which we maintain according to our current prefeerred shape: https://github.com/example-labs/ops-monorepo-demo
README standard
Repository READMEs must follow Standard Readme: https://github.com/RichardLitt/standard-readme/blob/main/spec.md.
Apply the standard when creating or editing README.md files:
- Use
README.md capitalization for Markdown READMEs. For translated READMEs, use BCP 47 language tags such as README.de.md; reserve README.md for English when multiple languages exist.
- Make the title match the repository, folder, and package-manager names, or explain any mismatch in the long description.
- Keep Standard Readme section order and exact section titles unless translating the README. Required sections include title, short description, contributing, and license; install and usage are required by default unless the repo is documentation-only.
- Keep the short description on its own line, under 120 characters, and not formatted as a blockquote.
- Include a table of contents for READMEs longer than 100 lines. It should link to all sections, capture at least all level-two headings, and start with the next section after the table of contents.
- Keep links working, lint code examples the same way the project lints source code, and keep the license section last.
- Use
standard-readme-preset (https://github.com/RichardLitt/standard-readme-preset) for remark-based linting when adding README checks.
- Use
generator-standard-readme (https://github.com/RichardLitt/generator-standard-readme) when scaffolding a new README from scratch.
ADR guidance
Use ADRs for decisions that cross-cut multiple skills, multiple teammates, or future work. In this repo, ADR conventions live in docs/adr/README.md; do not invent a parallel template inside a skill.
Write an ADR when the decision is durable and cross-cutting; skip ADRs for local implementation notes, ephemeral state, and project-local decisions that belong in .agent/context/decisions.md. Treat docs/adr/README.md as authoritative for the full write/do-not-write criteria.
When adding or updating ADRs:
- Read
docs/adr/README.md or the target project's ADR README first.
- Use the next zero-padded number and a kebab-case title.
- Keep the decision to one topic with context, decision, consequences, and alternatives considered.
- Use
proposed while under review; mark accepted only when the decision is real.
- Treat accepted ADRs as append-mostly history. If the decision changes, create a new ADR and mark the old one
superseded by ADR-XXXX.
- Link the ADR from the README, catalog, code comment, PR, or docs section where future readers will hit the governed behavior.
Organization workflow
- Inventory existing conventions before moving anything
- Identify the artifact type: always-on rule, project fact, policy, workflow, reusable skill, command, plugin, tool, script, reference doc, or decision.
- Choose the narrowest durable home from the placement table.
- Preserve public entrypoints and compatibility shims unless the user explicitly approves a breaking cleanup.
- Move one concern at a time and update links in the same change.
- If a decision explains the new structure, add or update the ADR before claiming the structure is settled.
- Verify with repo-specific checks plus targeted searches for stale paths, duplicate guidance, and outdated catalog rows.
Common mistakes
- Putting always-follow policy in an on-demand skill; agents might not load it.
- Turning a skill into a junk drawer for project-specific state.
- Storing project facts in global presets where they leak into unrelated repos.
- Writing ADRs for unresolved debates instead of marking them
proposed or keeping them in a planning doc.
- Editing accepted ADR conclusions in place instead of superseding them.
- Moving files without updating provider shims, catalog entries, README tables, or internal links.
- Adding scripts under a skill when they are really repo maintenance helpers, or vice versa.
Review checklist
- The artifact lives at the layer where consumers will actually load it.
- Always-on context stayed short; detail moved to skills, workflows, reference docs, or ADRs.
- README changes follow Standard Readme naming, section order, required sections, link hygiene, and code-example linting.
- Project-local facts did not leak into team-wide skills or global presets.
- Team-wide skills have
SKILL.md frontmatter, a catalog row, and validation coverage.
- ADR-worthy decisions are recorded or intentionally deferred with a clear reason.
- Accepted ADRs are not silently rewritten; supersession chains are explicit.
- Links, shims, catalog rows, and examples still point at the new paths.
Tools
None. This is a pure prompt and review skill. Use repo-local validators and search commands for verification.
1---2name: repository-organization3description: Organize darkmatter repositories, READMEs, agent context, docs, scripts, skills, and ADRs into the right durable locations. Triggers when deciding where something belongs, restructuring repo layout, adding always-follow rules, or documenting architectural decisions. Do NOT trigger for Nix flake-specific layout work; use nix-flake-organization instead.4---56# Repository organization78Keep each repository easy for humans and agents to navigate by putting durable context, reusable guidance, automation, and decisions in the right layer. Prefer the smallest durable home that will be loaded at the time it matters.910## When to use1112- A user asks where to put a new instruction, convention, policy, skill, command, script, workflow, reference doc, or ADR.13- A repo is accumulating scattered Markdown, duplicated agent instructions, or ad hoc decision notes.14- A change introduces a naming, layout, vendor, architecture, security, deployment, or process decision that future contributors should not re-litigate.15- A README is being created, reorganized, or reviewed for standard structure.16- A user asks whether something belongs in `AGENTS.md`, `.agent/context/`, `.agent/policy/`, `.agent/workflows/`, `skills/`, `docs/`, `scripts/`, or `presets/`.17- A project is being bootstrapped from the darkmatter template and needs its local context filled in cleanly.1819## When NOT to use2021- The task is specifically reorganizing Nix flakes, flake-parts outputs, NixOS modules, nix-darwin modules, or Home Manager modules. Use `nix-flake-organization`.22- The user only asks to create or edit a team-wide skill. Use `dm-skill-creator`; layer this skill only for placement or ADR questions around that change.23- The user is asking for one-off implementation notes that do not need to survive beyond the current task.24- The repository already has a clear local convention that conflicts with this guidance and the user explicitly wants to preserve it. Follow the local convention and note the tradeoff.2526## Reference repo2728Refer to our living repo which we maintain according to our current prefeerred shape: https://github.com/example-labs/ops-monorepo-demo2930## README standard3132Repository READMEs must follow Standard Readme: `https://github.com/RichardLitt/standard-readme/blob/main/spec.md`.3334Apply the standard when creating or editing `README.md` files:35361. Use `README.md` capitalization for Markdown READMEs. For translated READMEs, use BCP 47 language tags such as `README.de.md`; reserve `README.md` for English when multiple languages exist.372. Make the title match the repository, folder, and package-manager names, or explain any mismatch in the long description.383. Keep Standard Readme section order and exact section titles unless translating the README. Required sections include title, short description, contributing, and license; install and usage are required by default unless the repo is documentation-only.394. Keep the short description on its own line, under 120 characters, and not formatted as a blockquote.405. Include a table of contents for READMEs longer than 100 lines. It should link to all sections, capture at least all level-two headings, and start with the next section after the table of contents.416. Keep links working, lint code examples the same way the project lints source code, and keep the license section last.427. Use `standard-readme-preset` (`https://github.com/RichardLitt/standard-readme-preset`) for remark-based linting when adding README checks.438. Use `generator-standard-readme` (`https://github.com/RichardLitt/generator-standard-readme`) when scaffolding a new README from scratch.4445## ADR guidance4647Use ADRs for decisions that cross-cut multiple skills, multiple teammates, or future work. In this repo, ADR conventions live in `docs/adr/README.md`; do not invent a parallel template inside a skill.4849Write an ADR when the decision is durable and cross-cutting; skip ADRs for local implementation notes, ephemeral state, and project-local decisions that belong in `.agent/context/decisions.md`. Treat `docs/adr/README.md` as authoritative for the full write/do-not-write criteria.5051When adding or updating ADRs:52531. Read `docs/adr/README.md` or the target project's ADR README first.542. Use the next zero-padded number and a kebab-case title.553. Keep the decision to one topic with context, decision, consequences, and alternatives considered.564. Use `proposed` while under review; mark `accepted` only when the decision is real.575. Treat accepted ADRs as append-mostly history. If the decision changes, create a new ADR and mark the old one `superseded by ADR-XXXX`.586. Link the ADR from the README, catalog, code comment, PR, or docs section where future readers will hit the governed behavior.5960## Organization workflow61621. Inventory existing conventions before moving anything632. Identify the artifact type: always-on rule, project fact, policy, workflow, reusable skill, command, plugin, tool, script, reference doc, or decision.643. Choose the narrowest durable home from the placement table.654. Preserve public entrypoints and compatibility shims unless the user explicitly approves a breaking cleanup.665. Move one concern at a time and update links in the same change.676. If a decision explains the new structure, add or update the ADR before claiming the structure is settled.687. Verify with repo-specific checks plus targeted searches for stale paths, duplicate guidance, and outdated catalog rows.6970## Common mistakes7172- Putting always-follow policy in an on-demand skill; agents might not load it.73- Turning a skill into a junk drawer for project-specific state.74- Storing project facts in global presets where they leak into unrelated repos.75- Writing ADRs for unresolved debates instead of marking them `proposed` or keeping them in a planning doc.76- Editing accepted ADR conclusions in place instead of superseding them.77- Moving files without updating provider shims, catalog entries, README tables, or internal links.78- Adding scripts under a skill when they are really repo maintenance helpers, or vice versa.7980## Review checklist8182- The artifact lives at the layer where consumers will actually load it.83- Always-on context stayed short; detail moved to skills, workflows, reference docs, or ADRs.84- README changes follow Standard Readme naming, section order, required sections, link hygiene, and code-example linting.85- Project-local facts did not leak into team-wide skills or global presets.86- Team-wide skills have `SKILL.md` frontmatter, a catalog row, and validation coverage.87- ADR-worthy decisions are recorded or intentionally deferred with a clear reason.88- Accepted ADRs are not silently rewritten; supersession chains are explicit.89- Links, shims, catalog rows, and examples still point at the new paths.9091## Tools9293None. This is a pure prompt and review skill. Use repo-local validators and search commands for verification.