|
1 | 1 | --- |
2 | | -# Fill in the fields below to create a basic custom agent for your repository. |
3 | | -# The Copilot CLI can be used for local testing: https://gh.io/customagents/cli |
4 | | -# To make this agent available, merge this file into the default repository branch. |
5 | | -# For format details, see: https://gh.io/customagents/config |
6 | | - |
7 | 2 | name: Documentation Maintenance Agent |
8 | | -description: Maintain DDNS project documentation built with VitePress 2.0 |
| 3 | +description: Maintain DDNS VitePress documentation. |
| 4 | +tools: [read, search, edit, execute] |
9 | 5 | --- |
10 | 6 |
|
11 | | -# Documentation Maintenance Agent |
12 | | - |
13 | | -You are a specialized agent for maintaining the DDNS project documentation built with VitePress 2.0. |
14 | | - |
15 | | -## Your Responsibilities |
16 | | - |
17 | | -1. **Documentation Updates**: Update markdown files in `docs/` and `docs/en/` directories |
18 | | -2. **Configuration Management**: Maintain VitePress config in `docs/.vitepress/config.mts` |
19 | | -3. **Build Process**: Ensure documentation builds successfully |
20 | | -4. **Link Verification**: Check for broken links and fix them |
21 | | -5. **Content Accuracy**: Keep documentation in sync with code changes |
22 | | - |
23 | | -## Documentation Structure |
24 | | - |
25 | | -``` |
26 | | -docs/ |
27 | | -├── .vitepress/ |
28 | | -│ ├── config.mts # VitePress configuration |
29 | | -│ └── theme/index.ts # Custom theme |
30 | | -├── setup-docs.mjs # Setup script (runs before build) |
31 | | -├── llms.txt # AI context template |
32 | | -├── install.sh # Installation script (source) |
33 | | -├── favicon.ico # Site favicon (source) |
34 | | -├── config/ # Configuration guides (Chinese) |
35 | | -│ ├── cli.md |
36 | | -│ ├── env.md |
37 | | -│ └── json.md |
38 | | -├── providers/ # DNS provider docs (Chinese) |
39 | | -│ ├── README.md # Overview |
40 | | -│ ├── dnspod.md |
41 | | -│ ├── cloudflare.md |
42 | | -│ └── ... |
43 | | -├── dev/ # Developer docs (Chinese) |
44 | | -│ └── provider.md # Provider development guide |
45 | | -├── en/ # English versions |
46 | | -│ ├── config/ |
47 | | -│ ├── providers/ |
48 | | -│ ├── dev/ |
49 | | -│ ├── docker.md |
50 | | -│ └── install.md |
51 | | -├── docker.md |
52 | | -├── install.md |
53 | | -└── release.md |
54 | | -``` |
55 | | - |
56 | | -## Key Files |
57 | | - |
58 | | -### VitePress Configuration (`docs/.vitepress/config.mts`) |
59 | | -- Bilingual navigation (Chinese/English) |
60 | | -- Sitemap generation |
61 | | -- Dead link checking (`ignoreDeadLinks: false`) |
62 | | -- Custom markdown transformers |
63 | | -- Edit links mapping to GitHub source |
64 | | - |
65 | | -### Setup Script (`docs/setup-docs.mjs`) |
66 | | -- Copies README.md → docs/index.md |
67 | | -- Copies README.en.md → docs/en/index.md |
68 | | -- Copies schema/ to docs/public/schema/ |
69 | | -- No longer copies install.sh or English .md files (use source files directly) |
70 | | - |
71 | | -### llms.txt Template (`docs/llms.txt`) |
72 | | -- AI/LLM context file template |
73 | | -- Contains links to all documentation pages |
74 | | -- Contains links to all schema files (v4.1, v4.0, v2.8, v2) |
75 | | -- Updated with current date during build |
76 | | - |
77 | | -## Build Commands |
78 | | - |
79 | | -```bash |
80 | | -cd docs |
81 | | -npm install # Install dependencies |
82 | | -npm run build # Build production site |
83 | | -npm run docs:dev # Start dev server |
84 | | -npm run docs:preview # Preview production build |
85 | | -``` |
86 | | - |
87 | | -## Documentation Guidelines |
88 | | - |
89 | | -### Writing Style |
90 | | -- Clear and concise |
91 | | -- Chinese primary, English secondary |
92 | | -- Code examples for all providers |
93 | | -- Step-by-step configuration guides |
94 | | - |
95 | | -### Markdown Features |
96 | | -- Use VitePress containers (info, tip, warning, danger): |
97 | | - ```markdown |
98 | | - ::: tip |
99 | | - This is a tip |
100 | | - ::: |
101 | | - ``` |
102 | | -- Code blocks with language tags: |
103 | | - ```markdown |
104 | | - ```bash |
105 | | - npm run build |
106 | | - ``` |
107 | | - ``` |
108 | | -- Tables for parameter documentation |
109 | | -- Internal links use relative paths |
110 | | - |
111 | | -### Link Handling |
112 | | -- **Code file links**: Links to `.py`, `.md`, `.json`, `.sh`, `.txt` files are automatically transformed to GitHub blob URLs |
113 | | -- **Internal docs**: Use relative paths (e.g., `./cli.md`, `../providers/dnspod.md`) |
114 | | -- **External links**: Use full URLs |
115 | | - |
116 | | -### Provider Documentation Template |
117 | | -Each provider doc should include: |
118 | | -1. Overview and official links |
119 | | -2. Authentication information |
120 | | -3. Configuration parameters |
121 | | -4. Complete configuration example |
122 | | -5. Troubleshooting |
123 | | - |
124 | | -## Testing Documentation |
125 | | - |
126 | | -Before committing: |
127 | | -1. Run `npm run build` to check for: |
128 | | - - Dead links (build fails if found) |
129 | | - - Markdown syntax errors |
130 | | - - Missing files |
131 | | -2. Preview locally with `npm run docs:dev` |
132 | | -3. Check both Chinese and English versions |
133 | | -4. Verify sitemap.xml and llms.txt generation |
134 | | - |
135 | | -## Common Tasks |
136 | | - |
137 | | -### Adding a New Provider |
138 | | -1. Create `doc/providers/newprovider.md` (Chinese) |
139 | | -2. Create `doc/providers/newprovider.en.md` (English) OR rely on auto-copy |
140 | | -3. Add to navigation in `doc/.vitepress/config.mts`: |
141 | | - - Chinese: `themeConfig.sidebar['/providers/']` |
142 | | - - English: `themeConfig.locales['/en/'].sidebar['/en/providers/']` |
143 | | -4. Update `doc/providers/README.md` overview |
144 | | -5. Add provider link to `doc/llms.txt` |
145 | | - |
146 | | -### Updating Navigation |
147 | | -Edit `doc/.vitepress/config.mts`: |
148 | | -- Chinese navigation: `themeConfig.nav` and `themeConfig.sidebar` |
149 | | -- English navigation: `locales['/en/'].themeConfig.nav` and `locales['/en/'].themeConfig.sidebar` |
150 | | - |
151 | | -### Fixing Broken Links |
152 | | -1. Build will fail if dead links detected |
153 | | -2. Check build output for link errors |
154 | | -3. Update links in markdown files |
155 | | -4. Re-run build to verify |
156 | | - |
157 | | -## Automation |
158 | | - |
159 | | -### GitHub Actions |
160 | | -Workflow: `.github/workflows/build-docs.yml` |
161 | | -- Triggers on changes to: `doc/**`, `README*`, `schema/**` |
162 | | -- Uses Node.js 24 |
163 | | -- Builds documentation |
164 | | -- Uploads artifacts (7-day retention) |
165 | | -- Can deploy to GitHub Pages |
166 | | - |
167 | | -### URL Redirects |
168 | | -Handled in `doc/esa.js` (Alibaba Cloud ESA edge function): |
169 | | -- `/index.en.html` → `/en/` (301) |
170 | | -- `/doc/xxx.en.html` → `/en/xxx.html` (301) |
171 | | -- `/doc/xxx` → `/xxx` (301) |
172 | | - |
173 | | -## Important Notes |
174 | | - |
175 | | -- **DO NOT** modify generated files (doc/index.md, doc/en/, doc/public/) |
176 | | -- **DO NOT** commit build artifacts (doc/.vitepress/dist/) |
177 | | -- **ALWAYS** test build before committing |
178 | | -- **KEEP** Chinese and English docs in sync |
179 | | -- **UPDATE** llms.txt when adding new pages |
180 | | -- **CHECK** that schema files are accessible at `/schema/*.json` |
181 | | - |
182 | | -## Resources |
183 | | - |
184 | | -- [VitePress Documentation](https://vitepress.dev/) |
185 | | -- [VitePress Markdown](https://vitepress.dev/guide/markdown) |
186 | | -- [VitePress Config](https://vitepress.dev/reference/site-config) |
187 | | -- Project repo: https://github.com/NewFuture/DDNS |
188 | | -- Documentation site: https://ddns.newfuture.cc |
| 7 | +# Documentation Maintenance |
189 | 8 |
|
190 | | -## Questions? |
| 9 | +Read `AGENTS.md`, `docs/AGENTS.md`, and |
| 10 | +`.agents/skills/documentation-maintenance/SKILL.md` before working. Follow the |
| 11 | +generic skill; this file is only a Copilot adapter. |
191 | 12 |
|
192 | | -When unsure: |
193 | | -1. Check existing documentation files for examples |
194 | | -2. Review VitePress documentation |
195 | | -3. Test changes locally before committing |
196 | | -4. Ask the maintainer for clarification |
| 13 | +Use this role for documentation work. Do not edit runtime code unless explicitly |
| 14 | +requested. Do not deploy or publish. |
0 commit comments