Loading...
Loading...
Document Architecture Specification (L0-L4 + common layers) and omo rule generation. Generate rules under .omo/rules/docs/ for specific projects to optimize project documentation; this skill only operates/modifies files under .omo/rules/docs/, and only generates rules without creating documentation. Two file modes: Files without the .template suffix (such as CONSTITUTION) are global Rules themselves (frontmatter copied from omo + full file content, alwaysApply globally injected); Files with the .template suffix are templates, and the generated rule = frontmatter (copied from omo fields) + four sections of main content (inline translation of generation: Trigger Conditions/Execution Process/Hard Requirements/Completion Criteria) + the "Template" section (template Markdown content, excluding YAML frontmatter). It is only triggered when the user manually requests to update the documentation specification (generate/update rules under .omo/rules/docs/), and does not trigger automatically.
npx skill4agent add syllr/skills doc-arch-rules.omo/rules/docs/references/templates/.omo/rules/docs/references/templatesL2/deep-dives/L2/research/docs/**| File Type | What it is | Rule Content | Trigger Method |
|---|---|---|---|
Without | Global Rule Source | frontmatter (copied from omo: | |
With | Template | frontmatter (copied from omo: | |
.omo/rules/docs/Each time this skill is called, regenerate all rules in batches: overwrite in batches according to the §File List SSOT (see the table above), instead of generating documentation.
references/templates/| Layer | File | Type | Rule Output | Trigger Method |
|---|---|---|---|---|
| CONSTITUTION | CONSTITUTION (no suffix) | Global Rule Source | .omo/rules/docs/CONSTITUTION.md | alwaysApply |
| L1 | README | Template | .omo/rules/docs/L1/README.md | globs (root README.md) |
| L1 | PRODUCT | Template | .omo/rules/docs/L1/PRODUCT.md | globs |
| L1 | USER-STORY | Template | .omo/rules/docs/L1/USER-STORY.md | globs |
| L2 | APPLICATION-ARCHITECTURE | Template | .omo/rules/docs/L2/APPLICATION-ARCHITECTURE.md | globs |
| L2 | DOMAIN-MODEL | Template | .omo/rules/docs/L2/DOMAIN-MODEL.md | globs |
| L2 | TECHNOLOGY-ARCHITECTURE | Template | .omo/rules/docs/L2/TECHNOLOGY-ARCHITECTURE.md | globs |
| L2/deep-dives | INDEX | Template | .omo/rules/docs/L2/deep-dives/INDEX.md | globs |
| L2/deep-dives | DEEP-DIVE | Template | .omo/rules/docs/L2/deep-dives/DEEP-DIVE.md (directory-level wildcard, globs: docs/L2/deep-dives/*.md covers multiple documents in the directory, single physical rule) | globs |
| L2/research | RESEARCH | Template | .omo/rules/docs/L2/research/RESEARCH.md (directory-level wildcard, globs: docs/L2/research/*.md covers multiple documents in the directory, single physical rule, independent without index; no INDEX, different from deep-dives' INDEX management) | globs |
| L3 | API | Template | .omo/rules/docs/L3/API.md | globs |
| L3 | INTEGRATION | Template | .omo/rules/docs/L3/INTEGRATION.md | globs |
| L4 | DEPLOYMENT | Template | .omo/rules/docs/L4/DEPLOYMENT.md | globs |
| L4 | TEST-PLAN | Template | .omo/rules/docs/L4/TEST-PLAN.md | globs |
| common | CODE-GUIDE | Template | .omo/rules/docs/common/CODE-GUIDE.md | globs |
| common | GLOSSARY | Template | .omo/rules/docs/common/GLOSSARY.md | globs |
| common | STRUCTURE | Template | .omo/rules/docs/common/STRUCTURE.md | globs |
DATA-ARCHITECTURE has been merged into DOMAIN-MODEL (§5 Data Design), no rule will be generated. Theblock in template frontmatter (tools/related/ask_user/flow/notes/checks) is the generation prompt for the target document corresponding to the rule (path specified bygenerationunderglobs), only held by the template——when generating rules, it is inline translated into the four sections of the main content, without retaining YAML format.1docs/**
descriptionalwaysApplyglobstoolsrelatedask_userflownoteschecksScripts can be used to assist parsing (see "Script Usage"):outputs JSON (node <skill>/scripts/parse-template.mjs <template path>+omo+generation), avoiding errors from manually reading YAML.content
<DOC>/<Layer Chinese>/<target>| Placeholder | Value |
|---|---|
| constitution→宪法, L1→L1 产品层, L2→L2 架构层, L3→L3 契约层, L4→L4 交付层, common→common 贯穿层 (same as scripts/parse-template.mjs); subdirectories inherit parent layer Chinese (e.g., L2/deep-dives→L2 架构层; research inherits L2 similarly) |
| Template filename with |
| Special target | README→README.md (root) |
| Other targets | Copy verbatim from globs[0], no derivation |
---
description: <copy template description>
alwaysApply: true
---
<full template content (constitution clauses, no generation)>---
description: <copy template description>
globs:
- "<copy template globs>"
---
# <DOC> Documentation Update Specification (<Layer Chinese>)
## Trigger Conditions
This rule must take effect when any of the following occurs:
- Edit, add or rebuild `<target>`
- Associated document changes require linked updates:
- `<Associated Document 1>` (<Linkage Description>)
- `<Associated Document 2>` (<Linkage Description>)
- User requests "generate/update <DOC>"
## Execution Process
1. **Tools**: <list content of tools item by item>
2. **Ask User** (only when ambiguous): <list content of ask_user item by item>
3. **Generation Process** (including reading input sources/checking target status/detecting projects): <list content of flow item by item>
4. **Linked Synchronization**: After modifying the target document, first read associated documents to determine impacts, modify affected ones synchronously, and verify consistency of associations after completion
## Hard Requirements
- <list content of notes item by item>
- **Linkage**: Synchronize associated documents according to related when updating (see Trigger Conditions); cross-layer references are unidirectional downward, lower layers do not link back to upper layers
- **Graph Specification**: Use D2 / Mermaid / ASCII according to CONSTITUTION §3.2
## Completion Criteria
All of the following must be met to consider completion:
- <checks 1>
- <checks 2>
- ...
---
## Template (Structure Benchmark for Generating/Updating Documentation)
The following is the template content of `<target>` (excluding YAML frontmatter, use this structure as the basis for generation/update, fill in according to `> 【Guidance】`, examples without `> 【Guidance】` are explanations):
<template Markdown content>descriptionalwaysApplyglobs> 【Guidance】---.omo/rules/docs/<path><layer>/<DOC>.mdL2/deep-dives/<name>.mdL2/research/<name>.mdgeneration:deep-dives/INDEXsee deep-dives/researchsee research/grep -rn "see deep-dives/" .omo/rules/docs/L2/*.md | wc -lgrep -rn "see research/" .omo/rules/docs/L2/*.md | wc -l--check--allnode <skill>/scripts/parse-template.mjs <template path> # Parse a single template, output JSON: {omo, target, generation, content}
node <skill>/scripts/parse-template.mjs --check <rule path> <template path> # Verify rule (consistent frontmatter + no generation YAML + consistent template section content)is the actual installation path of the skill (global<skill>or project-level~/.config/opencode/skills/doc-arch-rules), which can be detected first:.opencode/skills/doc-arch-rules
skill=$(ls -d ~/.config/opencode/skills/doc-arch-rules .opencode/skills/doc-arch-rules 2>/dev/null | head -1) # Detect the actual installation path of the skill for use as <skill> placeholder
test -n "$skill" || echo "Skill not found (not installed or path does not match, please specify <skill> manually)"references/templates/.omo/rules/docs/references/templates/...@path./xxxrelatedrelated.omo/rules/docs/<DOC>.md.omo/references/templates/references/templates/<layer>/L2/deep-dives/L2/research/deep-divesresearchdescriptionalwaysApplyglobsLAYER_ZHSPECIAL_TARGETSSKIP_FILESscanrelatedflow