@buresmi7/agent-doc-rules-skill 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +250 -0
- package/SKILL.md +129 -0
- package/agents/openai.yaml +4 -0
- package/assets/templates/AGENTS.overlay.md +35 -0
- package/assets/templates/AGENTS.project.md +31 -0
- package/bin/install.mjs +128 -0
- package/docs/adoption.md +144 -0
- package/docs/config-reference.md +208 -0
- package/docs/context-placement.md +147 -0
- package/docs/recipes.md +136 -0
- package/docs/tool-map.md +65 -0
- package/package.json +42 -0
- package/references/agents-rubric.md +44 -0
- package/references/agents-rules.md +89 -0
- package/references/doc-audit.md +58 -0
- package/references/documentation-architecture.md +63 -0
- package/references/factual-review.md +108 -0
- package/references/influences.md +63 -0
- package/references/readme-rubric.md +38 -0
- package/references/readme-rules.md +124 -0
- package/references/security-review.md +75 -0
- package/references/validation.md +96 -0
- package/references/writing-style.md +77 -0
package/docs/adoption.md
ADDED
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
# Adoption Guide
|
|
2
|
+
|
|
3
|
+
Use this guide to add `agent-doc-rules` to an existing repository.
|
|
4
|
+
|
|
5
|
+
The goal is a small setup:
|
|
6
|
+
|
|
7
|
+
- one installed skill,
|
|
8
|
+
- a concise `AGENTS.md`,
|
|
9
|
+
- optional documentation checks,
|
|
10
|
+
- a clear update path.
|
|
11
|
+
|
|
12
|
+
## Install The Skill
|
|
13
|
+
|
|
14
|
+
Install the published npm package from the repository root:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npx @buresmi7/agent-doc-rules-skill
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
The npm installer creates:
|
|
21
|
+
|
|
22
|
+
- `.agents/skills/agent-doc-rules/`
|
|
23
|
+
|
|
24
|
+
It copies only the public skill artifact, not this monorepo's E2E fixtures,
|
|
25
|
+
support scripts, generated maintainer skills, or root docs.
|
|
26
|
+
|
|
27
|
+
Use a tagged skill directory with the `skills` CLI when the consuming repository
|
|
28
|
+
wants a `skills-lock.json` entry:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
npx skills add https://github.com/<owner>/<repo>/tree/<tag>/packages/agent-doc-rules-skill --skill agent-doc-rules -a codex -y --copy
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
For local testing from this repository, install the working tree:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
npx skills add ./packages/agent-doc-rules-skill --skill agent-doc-rules -a codex -y --copy
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
The `skills add` path should create:
|
|
41
|
+
|
|
42
|
+
- `.agents/skills/agent-doc-rules/`
|
|
43
|
+
- `skills-lock.json`
|
|
44
|
+
|
|
45
|
+
Commit `skills-lock.json`. Do not edit generated skill files by hand unless the
|
|
46
|
+
project intentionally vendors them.
|
|
47
|
+
|
|
48
|
+
## Add Or Repair AGENTS.md
|
|
49
|
+
|
|
50
|
+
Ask an agent to create or repair the root instructions:
|
|
51
|
+
|
|
52
|
+
```text
|
|
53
|
+
Use $agent-doc-rules to create a concise root AGENTS.md for this repository.
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
For a manual starting point, adapt
|
|
57
|
+
[`../assets/templates/AGENTS.project.md`](../assets/templates/AGENTS.project.md).
|
|
58
|
+
|
|
59
|
+
A good root `AGENTS.md` should include:
|
|
60
|
+
|
|
61
|
+
- a short project orientation,
|
|
62
|
+
- links to installed shared rules,
|
|
63
|
+
- local source-of-truth docs,
|
|
64
|
+
- narrow project-specific constraints,
|
|
65
|
+
- verification commands.
|
|
66
|
+
|
|
67
|
+
## Add Documentation Checks
|
|
68
|
+
|
|
69
|
+
Install the deterministic validator when the project wants Markdown, security,
|
|
70
|
+
and local link checks:
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
pnpm add -D @agent-doc-rules/docs-validator
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Install the duplicate checker when the project also wants semantic overlap
|
|
77
|
+
review:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
pnpm add -D @agent-doc-rules/docs-duplicates
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Add scripts like these:
|
|
84
|
+
|
|
85
|
+
```json
|
|
86
|
+
{
|
|
87
|
+
"scripts": {
|
|
88
|
+
"docs:markdown": "agent-doc-rules-docs markdown",
|
|
89
|
+
"docs:wording": "agent-doc-rules-docs wording",
|
|
90
|
+
"docs:security": "agent-doc-rules-docs security",
|
|
91
|
+
"docs:style": "agent-doc-rules-docs-duplicates style",
|
|
92
|
+
"docs:links": "agent-doc-rules-docs links",
|
|
93
|
+
"docs:duplicates": "agent-doc-rules-docs-duplicates check",
|
|
94
|
+
"docs:check": "agent-doc-rules-docs check && agent-doc-rules-docs-duplicates style && agent-doc-rules-docs-duplicates check"
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
For starter config generation, use the `init` command documented in
|
|
100
|
+
[docs-validator](../../docs-validator/README.md). See
|
|
101
|
+
[Config Reference](config-reference.md) for supported keys.
|
|
102
|
+
|
|
103
|
+
## Verify The Setup
|
|
104
|
+
|
|
105
|
+
Run the checks that exist in the consuming repository. A common path is:
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
pnpm run docs:check
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
If the repository does not install the optional tools, ask the agent to name the
|
|
112
|
+
nearest available Markdown, link, or documentation check before finishing docs
|
|
113
|
+
changes.
|
|
114
|
+
|
|
115
|
+
## Update The Skill
|
|
116
|
+
|
|
117
|
+
Use the same install command with a newer package version or tag when the
|
|
118
|
+
project wants to update `agent-doc-rules`. For npm installs, run:
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
npx @buresmi7/agent-doc-rules-skill@latest --force
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Review the generated diff before committing. If the project uses
|
|
125
|
+
`skills-lock.json`, review the lockfile change as well.
|
|
126
|
+
|
|
127
|
+
For repositories that use `skills-lock.json`, treat lockfile changes as a review
|
|
128
|
+
point. The lockfile should change only when the project accepts the new skill
|
|
129
|
+
content.
|
|
130
|
+
|
|
131
|
+
## Distribution Boundary
|
|
132
|
+
|
|
133
|
+
The published skill artifact contains:
|
|
134
|
+
|
|
135
|
+
- `SKILL.md`
|
|
136
|
+
- `README.md`
|
|
137
|
+
- `agents/`
|
|
138
|
+
- `assets/`
|
|
139
|
+
- `bin/`
|
|
140
|
+
- `docs/`
|
|
141
|
+
- `references/`
|
|
142
|
+
|
|
143
|
+
It does not include this monorepo's root maintainer docs, E2E fixtures, support
|
|
144
|
+
scripts, or generated project-scoped maintainer skills.
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
# Config Reference
|
|
2
|
+
|
|
3
|
+
`agent-doc-rules` documentation tools read `agent-doc-rules.config.json` from
|
|
4
|
+
the repository root by default.
|
|
5
|
+
|
|
6
|
+
The file may contain a top-level `docs` object:
|
|
7
|
+
|
|
8
|
+
```json
|
|
9
|
+
{
|
|
10
|
+
"docs": {
|
|
11
|
+
"include": ["*.md", "docs/**/*.md", "**/AGENTS.md"],
|
|
12
|
+
"exclude": ["node_modules/**", ".git/**", "dist/**", "coverage/**"],
|
|
13
|
+
"links": {
|
|
14
|
+
"skip": ["^https://example.invalid"],
|
|
15
|
+
"checkFragments": true
|
|
16
|
+
},
|
|
17
|
+
"wording": {
|
|
18
|
+
"writeGood": {
|
|
19
|
+
"passive": false,
|
|
20
|
+
"illusion": false,
|
|
21
|
+
"weasel": false,
|
|
22
|
+
"adverb": false,
|
|
23
|
+
"tooWordy": false,
|
|
24
|
+
"eprime": false,
|
|
25
|
+
"fail": false
|
|
26
|
+
},
|
|
27
|
+
"forbiddenTerms": [],
|
|
28
|
+
"allow": ["intentional example"]
|
|
29
|
+
},
|
|
30
|
+
"security": {
|
|
31
|
+
"allow": ["intentional fixture"]
|
|
32
|
+
},
|
|
33
|
+
"style": {
|
|
34
|
+
"includeReferences": false,
|
|
35
|
+
"maxUnits": 80,
|
|
36
|
+
"model": "gpt-5-nano",
|
|
37
|
+
"reasoningEffort": "low"
|
|
38
|
+
},
|
|
39
|
+
"duplicates": {
|
|
40
|
+
"includeReferences": false,
|
|
41
|
+
"includeSameFile": false,
|
|
42
|
+
"warnScore": 0.78,
|
|
43
|
+
"failScore": 0.92,
|
|
44
|
+
"minWords": 6,
|
|
45
|
+
"minChars": 40,
|
|
46
|
+
"maxCandidates": 50,
|
|
47
|
+
"ignorePairs": [],
|
|
48
|
+
"model": "gpt-5-nano",
|
|
49
|
+
"reasoningEffort": "low"
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
CLI flags override config values. Config values override built-in defaults.
|
|
56
|
+
|
|
57
|
+
## Shared Keys
|
|
58
|
+
|
|
59
|
+
| Key | Type | Used By | Description |
|
|
60
|
+
| --- | --- | --- | --- |
|
|
61
|
+
| `docs.include` | string array | validator and duplicate checker | Markdown globs to include. |
|
|
62
|
+
| `docs.exclude` | string array | validator and duplicate checker | Globs to ignore. |
|
|
63
|
+
|
|
64
|
+
Default includes:
|
|
65
|
+
|
|
66
|
+
```json
|
|
67
|
+
[
|
|
68
|
+
"*.md",
|
|
69
|
+
"docs/**/*.md",
|
|
70
|
+
"**/AGENTS.md",
|
|
71
|
+
".agents/skills/**/*.md",
|
|
72
|
+
"packages/**/*.md",
|
|
73
|
+
"rules/**/*.md",
|
|
74
|
+
".codex/**/*.md"
|
|
75
|
+
]
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Default excludes:
|
|
79
|
+
|
|
80
|
+
```json
|
|
81
|
+
[
|
|
82
|
+
"node_modules/**",
|
|
83
|
+
".git/**",
|
|
84
|
+
"dist/**",
|
|
85
|
+
"coverage/**",
|
|
86
|
+
".tmp/**",
|
|
87
|
+
"repos/**",
|
|
88
|
+
"worktrees/**"
|
|
89
|
+
]
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## Link Keys
|
|
93
|
+
|
|
94
|
+
`docs.links` configures `agent-doc-rules-docs links` and the link phase of
|
|
95
|
+
`agent-doc-rules-docs check`.
|
|
96
|
+
|
|
97
|
+
| Key | Type | Description |
|
|
98
|
+
| --- | --- | --- |
|
|
99
|
+
| `docs.links.include` | string array | Optional include override for link validation. |
|
|
100
|
+
| `docs.links.exclude` | string array | Optional exclude override for link validation. |
|
|
101
|
+
| `docs.links.skip` | string array | Linkinator skip regexes. |
|
|
102
|
+
| `docs.links.checkFragments` | boolean | Whether to validate URL fragments. Defaults to `true`. |
|
|
103
|
+
|
|
104
|
+
Use `--skip <regex>` for one-off skip patterns and `--no-fragments` when a
|
|
105
|
+
repository has generated anchors the checker cannot resolve.
|
|
106
|
+
|
|
107
|
+
## Wording Keys
|
|
108
|
+
|
|
109
|
+
`docs.wording` configures `agent-doc-rules-docs wording` and the wording phase of
|
|
110
|
+
`agent-doc-rules-docs check`.
|
|
111
|
+
|
|
112
|
+
The validator runs `write-good` with a low-noise default profile. It skips
|
|
113
|
+
fenced code blocks, inline code, and Markdown tables. Optional configured
|
|
114
|
+
wording terms can still fail the check when a project has a phrase it must not
|
|
115
|
+
use.
|
|
116
|
+
|
|
117
|
+
| Key | Type | Description |
|
|
118
|
+
| --- | --- | --- |
|
|
119
|
+
| `docs.wording.include` | string array | Optional include override for wording validation. |
|
|
120
|
+
| `docs.wording.exclude` | string array | Optional exclude override for wording validation. |
|
|
121
|
+
| `docs.wording.writeGood` | object or `false` | `write-good` options. Set `fail: true` to make suggestions fail the command. Set `false` to disable `write-good`. |
|
|
122
|
+
| `docs.wording.forbiddenTerms` | string or object array | Optional project-specific terms that should fail. Objects use `term` and optional `suggest`. |
|
|
123
|
+
| `docs.wording.allow` | string array | Regexes for matching lines that should be ignored. |
|
|
124
|
+
|
|
125
|
+
The default `write-good` profile disables noisy checks for passive voice,
|
|
126
|
+
adverbs, weasel words, wordy phrases, lexical illusions, and E-Prime. Projects
|
|
127
|
+
can enable any supported `write-good` check in `docs.wording.writeGood`.
|
|
128
|
+
|
|
129
|
+
## Security Keys
|
|
130
|
+
|
|
131
|
+
`docs.security` configures `agent-doc-rules-docs security` and the security
|
|
132
|
+
phase of `agent-doc-rules-docs check`.
|
|
133
|
+
|
|
134
|
+
The validator scans Markdown text and code blocks for high-risk instructions:
|
|
135
|
+
remote code execution, secret disclosure, prompt-injection language, validation
|
|
136
|
+
bypasses, backdoor-style guidance, remote images, tracking links, and encoded
|
|
137
|
+
execution payloads.
|
|
138
|
+
|
|
139
|
+
| Key | Type | Description |
|
|
140
|
+
| --- | --- | --- |
|
|
141
|
+
| `docs.security.include` | string array | Optional include override for security validation. |
|
|
142
|
+
| `docs.security.exclude` | string array | Optional exclude override for security validation. |
|
|
143
|
+
| `docs.security.allow` | string array | Regexes for matching lines that should be ignored. |
|
|
144
|
+
|
|
145
|
+
Use `docs.security.allow` only for intentional fixture content or safety docs
|
|
146
|
+
that need to show a risky pattern. Prefer rewriting examples so they do not look
|
|
147
|
+
like instructions an agent should execute.
|
|
148
|
+
|
|
149
|
+
## AI Style Keys
|
|
150
|
+
|
|
151
|
+
`docs.style` configures `agent-doc-rules-docs-duplicates style`.
|
|
152
|
+
|
|
153
|
+
| Key | Type | Description |
|
|
154
|
+
| --- | --- | --- |
|
|
155
|
+
| `docs.style.include` | string array | Optional include override for AI style review. |
|
|
156
|
+
| `docs.style.exclude` | string array | Optional exclude override for AI style review. |
|
|
157
|
+
| `docs.style.includeReferences` | boolean | Include `references/` directories. Defaults to `false`. |
|
|
158
|
+
| `docs.style.minWords` | number | Minimum words in a sentence unit. |
|
|
159
|
+
| `docs.style.minChars` | number | Minimum characters in a sentence unit. |
|
|
160
|
+
| `docs.style.maxUnits` | number | Maximum sentence units sent to Codex. |
|
|
161
|
+
| `docs.style.model` | string | Codex model for style review. |
|
|
162
|
+
| `docs.style.reasoningEffort` | string | Codex reasoning effort. |
|
|
163
|
+
|
|
164
|
+
## Duplicate Keys
|
|
165
|
+
|
|
166
|
+
`docs.duplicates` configures `agent-doc-rules-docs-duplicates check`.
|
|
167
|
+
|
|
168
|
+
| Key | Type | Description |
|
|
169
|
+
| --- | --- | --- |
|
|
170
|
+
| `docs.duplicates.include` | string array | Optional include override for duplicate review. |
|
|
171
|
+
| `docs.duplicates.exclude` | string array | Optional exclude override for duplicate review. |
|
|
172
|
+
| `docs.duplicates.includeReferences` | boolean | Include `references/` directories. Defaults to `false`. |
|
|
173
|
+
| `docs.duplicates.includeSameFile` | boolean | Compare prose units from the same file. Defaults to `false`. |
|
|
174
|
+
| `docs.duplicates.warnScore` | number | Minimum score for warning results. |
|
|
175
|
+
| `docs.duplicates.failScore` | number | Minimum score for failure results. |
|
|
176
|
+
| `docs.duplicates.minWords` | number | Minimum words in a prose unit. |
|
|
177
|
+
| `docs.duplicates.minChars` | number | Minimum characters in a prose unit. |
|
|
178
|
+
| `docs.duplicates.maxCandidates` | number | Maximum candidate pairs sent to Codex. |
|
|
179
|
+
| `docs.duplicates.ignorePairs` | object array | File-pair regexes that should be ignored before AI review. |
|
|
180
|
+
| `docs.duplicates.model` | string | Codex model for classification. |
|
|
181
|
+
| `docs.duplicates.reasoningEffort` | string | Codex reasoning effort. |
|
|
182
|
+
|
|
183
|
+
The duplicate checker skips code blocks and short noise before it builds
|
|
184
|
+
candidates. It sends only candidate pairs to Codex.
|
|
185
|
+
|
|
186
|
+
Use `ignorePairs` for expected overlaps such as E2E criteria repeating the rule
|
|
187
|
+
under test or standalone templates sharing boilerplate. Each entry uses `left`
|
|
188
|
+
and `right` regex strings matched against file paths; matching is symmetric.
|
|
189
|
+
|
|
190
|
+
## Init Command
|
|
191
|
+
|
|
192
|
+
Create a starter config:
|
|
193
|
+
|
|
194
|
+
```bash
|
|
195
|
+
agent-doc-rules-docs init
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
Preview it without writing:
|
|
199
|
+
|
|
200
|
+
```bash
|
|
201
|
+
agent-doc-rules-docs init --print
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
Overwrite an existing config only when the project has reviewed the replacement:
|
|
205
|
+
|
|
206
|
+
```bash
|
|
207
|
+
agent-doc-rules-docs init --force
|
|
208
|
+
```
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
# Context Placement
|
|
2
|
+
|
|
3
|
+
Use this guide when deciding where project information should live. Agents that
|
|
4
|
+
need only the short rule set should use
|
|
5
|
+
[Documentation Architecture](../references/documentation-architecture.md).
|
|
6
|
+
|
|
7
|
+
## Core Rule
|
|
8
|
+
|
|
9
|
+
Put each fact in the smallest durable home that serves the right reader.
|
|
10
|
+
|
|
11
|
+
If a fact is useful to humans, put it in human docs. If it changes agent
|
|
12
|
+
behavior on every task, put it in `AGENTS.md`. If it describes a repeatable
|
|
13
|
+
agent workflow, put it in a skill.
|
|
14
|
+
|
|
15
|
+
## Placement Matrix
|
|
16
|
+
|
|
17
|
+
| Home | Reader | Use For | Avoid |
|
|
18
|
+
| --- | --- | --- | --- |
|
|
19
|
+
| `README.md` | New human contributor | Project purpose, first useful action, canonical docs index, verified commands | Long runbooks, deep architecture, duplicated agent rules |
|
|
20
|
+
| `docs/` | Human maintainer | Architecture, how-to guides, reference, decisions, release notes, troubleshooting | Short routing rules that agents need on every task |
|
|
21
|
+
| `AGENTS.md` | Agent on every task | Local invariants, routing pointers, safety boundaries, verification commands | Long procedures, general documentation, copied reference text |
|
|
22
|
+
| `.agents/skills/<name>/` | Agent on matching task | Repeatable workflows, specialized judgment, bundled templates or scripts | One-off notes, facts humans need first, secrets |
|
|
23
|
+
| `references/` in a skill | Agent after skill triggers | Detailed rules, rubrics, examples, background | Always-needed instructions |
|
|
24
|
+
| `assets/` in a skill | Agent after skill triggers | Templates, examples, reusable output material | Policy prose that should be in references |
|
|
25
|
+
|
|
26
|
+
## README
|
|
27
|
+
|
|
28
|
+
Use `README.md` as the human entry point.
|
|
29
|
+
|
|
30
|
+
It should answer:
|
|
31
|
+
|
|
32
|
+
- what the project is,
|
|
33
|
+
- who should use it,
|
|
34
|
+
- where the source of truth lives,
|
|
35
|
+
- how to do the first useful action,
|
|
36
|
+
- how to verify common changes.
|
|
37
|
+
|
|
38
|
+
Move detail out when the README becomes a manual. Link to the nearest canonical
|
|
39
|
+
doc instead of copying content.
|
|
40
|
+
|
|
41
|
+
When creating more than one durable doc, add a compact canonical-docs section or
|
|
42
|
+
sentence in the README that links to each canonical doc the reader needs first.
|
|
43
|
+
|
|
44
|
+
Keep rationale, troubleshooting, release steps, and repair procedures out of the
|
|
45
|
+
README unless they are one-line pointers. Put the durable content in `docs/` and
|
|
46
|
+
link to it.
|
|
47
|
+
|
|
48
|
+
If an inbox note says why a format, workflow, or architecture choice exists,
|
|
49
|
+
the README may summarize that fact, but it must link to a `docs/` explanation or
|
|
50
|
+
architecture page that owns the rationale.
|
|
51
|
+
|
|
52
|
+
When triaging an inbox file such as `notes.md`, move every durable fact to its
|
|
53
|
+
new canonical home. Then remove the inbox file or replace it with a short pointer
|
|
54
|
+
that names those homes. Do not leave the original facts duplicated in the inbox.
|
|
55
|
+
|
|
56
|
+
## Docs
|
|
57
|
+
|
|
58
|
+
Use `docs/` for durable human-facing material.
|
|
59
|
+
|
|
60
|
+
Good `docs/` content includes:
|
|
61
|
+
|
|
62
|
+
- architecture decisions,
|
|
63
|
+
- rationale for format or architecture choices,
|
|
64
|
+
- setup details,
|
|
65
|
+
- release procedures,
|
|
66
|
+
- operational runbooks,
|
|
67
|
+
- troubleshooting, including fixture failures and repair steps,
|
|
68
|
+
- command and API reference,
|
|
69
|
+
- explanations of trade-offs.
|
|
70
|
+
|
|
71
|
+
Choose the document shape deliberately: tutorial, how-to, reference, or
|
|
72
|
+
explanation.
|
|
73
|
+
|
|
74
|
+
Keep explanation and repair content in `docs/` even when it starts as a short
|
|
75
|
+
note. A format rationale belongs in a dedicated explanation or architecture page
|
|
76
|
+
such as `docs/architecture.md` or `docs/output-format.md`, not as the main prose
|
|
77
|
+
inside a schema, importer, command, or API reference. Put fixture repair notes
|
|
78
|
+
beside the relevant troubleshooting material. `README.md` and reference docs may
|
|
79
|
+
summarize and link to those pages, but should not be their canonical home.
|
|
80
|
+
|
|
81
|
+
Use this placement even for one-sentence rationale notes. A short reason still
|
|
82
|
+
needs a stable explanation home when the user asks to organize durable notes.
|
|
83
|
+
|
|
84
|
+
## AGENTS.md
|
|
85
|
+
|
|
86
|
+
Use `AGENTS.md` for always-loaded agent instructions.
|
|
87
|
+
|
|
88
|
+
Good `AGENTS.md` content includes:
|
|
89
|
+
|
|
90
|
+
- project orientation,
|
|
91
|
+
- local constraints,
|
|
92
|
+
- language rules,
|
|
93
|
+
- safety boundaries,
|
|
94
|
+
- links to canonical docs,
|
|
95
|
+
- verification commands agents should know before editing,
|
|
96
|
+
- links to troubleshooting docs when checks fail.
|
|
97
|
+
|
|
98
|
+
Keep it short. Put troubleshooting procedures in docs or skills and link to
|
|
99
|
+
them. Verification guidance should make skipped checks auditable by recording
|
|
100
|
+
the blocker and what remains unverified.
|
|
101
|
+
|
|
102
|
+
Do not place fixture-failure procedures directly in `AGENTS.md`; link to the
|
|
103
|
+
troubleshooting or how-to document instead. Include the verification command and
|
|
104
|
+
a short skipped-check note requirement.
|
|
105
|
+
|
|
106
|
+
## Skills
|
|
107
|
+
|
|
108
|
+
Use a skill when a repeated agent task needs more than a static instruction.
|
|
109
|
+
|
|
110
|
+
Strong signals that information belongs in a skill:
|
|
111
|
+
|
|
112
|
+
- the text says the workflow is repeated,
|
|
113
|
+
- the workflow is meant for a coding agent or AI agent,
|
|
114
|
+
- the workflow has ordered steps, inputs, outputs, and review rules,
|
|
115
|
+
- the workflow needs bundled templates, references, or scripts.
|
|
116
|
+
|
|
117
|
+
A good skill contains:
|
|
118
|
+
|
|
119
|
+
- a clear trigger description,
|
|
120
|
+
- a short workflow,
|
|
121
|
+
- detailed references loaded only when needed,
|
|
122
|
+
- templates or scripts when they reduce repeated work.
|
|
123
|
+
|
|
124
|
+
When creating a skill from an existing README or doc, move the workflow into
|
|
125
|
+
`.agents/skills/<name>/SKILL.md` and leave only a short link from human docs or
|
|
126
|
+
`AGENTS.md`.
|
|
127
|
+
|
|
128
|
+
When a project gets a new local skill, create or update `AGENTS.md` so agents
|
|
129
|
+
can route to it from always-loaded context. Keep the `AGENTS.md` entry to one or
|
|
130
|
+
two bullets and link to the skill instead of copying the workflow.
|
|
131
|
+
|
|
132
|
+
Do not create a skill for facts that should be visible to humans first. Do not
|
|
133
|
+
create a skill for one-off project notes or ordinary human runbooks.
|
|
134
|
+
|
|
135
|
+
When a README contains an ordinary human runbook, move the detailed procedure to
|
|
136
|
+
`docs/` and leave a short README pointer. The fact that a workflow has steps is
|
|
137
|
+
not enough to make it a skill; the workflow must be meant for agents.
|
|
138
|
+
|
|
139
|
+
## Review Questions
|
|
140
|
+
|
|
141
|
+
Before adding information, ask:
|
|
142
|
+
|
|
143
|
+
- Who needs this first: a human, every agent task, or only one agent workflow?
|
|
144
|
+
- Will this fact stay true long enough to document?
|
|
145
|
+
- Is there already a canonical home for it?
|
|
146
|
+
- Would copying this text create two sources of truth?
|
|
147
|
+
- Does this need to be always loaded, or can it be loaded on demand?
|
package/docs/recipes.md
ADDED
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
# Recipes
|
|
2
|
+
|
|
3
|
+
These recipes mirror the behavior protected by the agent E2E scenarios in this
|
|
4
|
+
repository. Use them as examples when applying `agent-doc-rules` to another
|
|
5
|
+
project.
|
|
6
|
+
|
|
7
|
+
## Create Basic Agent Instructions
|
|
8
|
+
|
|
9
|
+
Prompt:
|
|
10
|
+
|
|
11
|
+
```text
|
|
12
|
+
Use $agent-doc-rules to create a concise root AGENTS.md for this repository.
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Expected result:
|
|
16
|
+
|
|
17
|
+
- the file starts with a short project orientation,
|
|
18
|
+
- shared rules are linked instead of copied,
|
|
19
|
+
- local source-of-truth docs are named,
|
|
20
|
+
- verification commands come from local manifests or existing docs.
|
|
21
|
+
|
|
22
|
+
## Leave Compliant Docs Alone
|
|
23
|
+
|
|
24
|
+
Prompt:
|
|
25
|
+
|
|
26
|
+
```text
|
|
27
|
+
Use $agent-doc-rules to review this repository's docs and repair problems.
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Expected result:
|
|
31
|
+
|
|
32
|
+
- no repository diff when the docs are already acceptable,
|
|
33
|
+
- a short note naming the checks or evidence used.
|
|
34
|
+
|
|
35
|
+
This protects repositories from style-only churn.
|
|
36
|
+
|
|
37
|
+
## Split A Bloated README
|
|
38
|
+
|
|
39
|
+
Prompt:
|
|
40
|
+
|
|
41
|
+
```text
|
|
42
|
+
Use $agent-doc-rules to trim this README and move long-lived detail to the right docs.
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Expected result:
|
|
46
|
+
|
|
47
|
+
- README follows [`readme-rules.md`](../references/readme-rules.md),
|
|
48
|
+
- architecture, operations, and troubleshooting move into `docs/`,
|
|
49
|
+
- stale or unsupported commands are removed.
|
|
50
|
+
|
|
51
|
+
## Place Notes In Canonical Homes
|
|
52
|
+
|
|
53
|
+
Prompt:
|
|
54
|
+
|
|
55
|
+
```text
|
|
56
|
+
Use $agent-doc-rules to triage notes.md into README, docs, AGENTS, or a project skill.
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Expected result:
|
|
60
|
+
|
|
61
|
+
- human orientation moves to README,
|
|
62
|
+
- rationale moves to an explanation or architecture doc,
|
|
63
|
+
- agent-only routing moves to `AGENTS.md`,
|
|
64
|
+
- agent-only workflow detail moves out of the note inbox,
|
|
65
|
+
- the note inbox no longer carries duplicated durable facts.
|
|
66
|
+
|
|
67
|
+
## Reject Unsupported Documentation Changes
|
|
68
|
+
|
|
69
|
+
Prompt:
|
|
70
|
+
|
|
71
|
+
```text
|
|
72
|
+
Use $agent-doc-rules to update the README with the new supported Node.js version.
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Expected result when local evidence disagrees:
|
|
76
|
+
|
|
77
|
+
- no unsupported edit is applied,
|
|
78
|
+
- the response names the conflicting manifest, config, source file, or doc,
|
|
79
|
+
- the maintainer gets the smallest needed fix path.
|
|
80
|
+
|
|
81
|
+
## Add Nested Agent Overrides
|
|
82
|
+
|
|
83
|
+
Prompt:
|
|
84
|
+
|
|
85
|
+
```text
|
|
86
|
+
Use $agent-doc-rules to add directory-specific rules for the importer package.
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Expected result:
|
|
90
|
+
|
|
91
|
+
- root `AGENTS.md` points to the nested file,
|
|
92
|
+
- nested `AGENTS.md` contains only directory-specific rules,
|
|
93
|
+
- root instructions do not copy nested details.
|
|
94
|
+
|
|
95
|
+
## Preserve Local Language Rules
|
|
96
|
+
|
|
97
|
+
Prompt:
|
|
98
|
+
|
|
99
|
+
```text
|
|
100
|
+
Use $agent-doc-rules to rewrite these docs in the repository's required language.
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Expected result:
|
|
104
|
+
|
|
105
|
+
- prose follows the repository language rule,
|
|
106
|
+
- file paths, commands, package names, and code identifiers stay unchanged,
|
|
107
|
+
- the rewrite does not add generic setup or deploy steps.
|
|
108
|
+
|
|
109
|
+
## Move Human Runbooks To Docs
|
|
110
|
+
|
|
111
|
+
Prompt:
|
|
112
|
+
|
|
113
|
+
```text
|
|
114
|
+
Use $agent-doc-rules to clean up this README and AGENTS.md.
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Expected result when the project has a human procedure:
|
|
118
|
+
|
|
119
|
+
- the full runbook moves to a `docs/` how-to,
|
|
120
|
+
- README links to the how-to,
|
|
121
|
+
- `AGENTS.md` keeps only routing, constraints, and checks,
|
|
122
|
+
- no project skill is created unless the workflow is specifically for agents.
|
|
123
|
+
|
|
124
|
+
## Redact Sensitive Notes
|
|
125
|
+
|
|
126
|
+
Prompt:
|
|
127
|
+
|
|
128
|
+
```text
|
|
129
|
+
Use $agent-doc-rules to move useful facts from notes.md into durable docs.
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
Expected result:
|
|
133
|
+
|
|
134
|
+
- safe durable facts move to canonical homes,
|
|
135
|
+
- customer names, emails, account IDs, private hosts, and tokens are not copied,
|
|
136
|
+
- the resulting docs name sensitive categories instead of example values.
|
package/docs/tool-map.md
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# Tool Map
|
|
2
|
+
|
|
3
|
+
Use this page to choose the smallest `agent-doc-rules` surface for a task.
|
|
4
|
+
|
|
5
|
+
| Goal | Use | Why |
|
|
6
|
+
| --- | --- | --- |
|
|
7
|
+
| Create or repair `AGENTS.md` | `$agent-doc-rules` plus [`references/agents-rules.md`](../references/agents-rules.md) | Keeps always-loaded agent context short and local. |
|
|
8
|
+
| Review an `AGENTS.md` file | `$agent-doc-rules` plus [`references/agents-rubric.md`](../references/agents-rubric.md) | Checks routing, scope, duplication, and verification guidance. |
|
|
9
|
+
| Shape a README | `$agent-doc-rules` plus [`references/readme-rules.md`](../references/readme-rules.md) | Keeps the README as a human entry point. |
|
|
10
|
+
| Review a README | `$agent-doc-rules` plus [`references/readme-rubric.md`](../references/readme-rubric.md) | Finds stale commands, missing orientation, placeholders, and overlong sections. |
|
|
11
|
+
| Decide where a fact belongs | [`docs/context-placement.md`](context-placement.md) | Separates README, docs, `AGENTS.md`, skills, references, and templates. |
|
|
12
|
+
| Repair bloated docs | [`references/doc-audit.md`](../references/doc-audit.md) | Moves durable facts to canonical homes and removes duplicated leftovers. |
|
|
13
|
+
| Check factual claims | [`references/factual-review.md`](../references/factual-review.md) | Compares docs against local evidence and rejects unsupported edits. |
|
|
14
|
+
| Review documentation security risks | [`references/security-review.md`](../references/security-review.md) and `agent-doc-rules-docs security` | Finds agent-instruction abuse, data leaks, validation bypasses, and tracking assets. |
|
|
15
|
+
| Tighten prose | [`references/writing-style.md`](../references/writing-style.md) | Removes vague or generic text without inventing workflows. |
|
|
16
|
+
| Check deterministic prose wording | `agent-doc-rules-docs wording` | Runs `write-good` and optional project wording rules against Markdown prose. |
|
|
17
|
+
| Review sentence style | `agent-doc-rules-docs-duplicates style` | Uses Codex to review Markdown sentence units for clarity and plain language. |
|
|
18
|
+
| Validate Markdown, security, and links | `agent-doc-rules-docs` | Runs deterministic Markdown, security, and local-link checks. |
|
|
19
|
+
| Find likely duplicate docs | `agent-doc-rules-docs-duplicates` | Uses deterministic candidates before asking Codex to classify overlap. |
|
|
20
|
+
|
|
21
|
+
## Command Split
|
|
22
|
+
|
|
23
|
+
Use the deterministic validator first:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
agent-doc-rules-docs check
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Use duplicate review as a separate semantic gate:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
agent-doc-rules-docs-duplicates check
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
The combined project script is usually:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
pnpm run docs:check
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Agent Prompt Examples
|
|
42
|
+
|
|
43
|
+
Create instructions:
|
|
44
|
+
|
|
45
|
+
```text
|
|
46
|
+
Use $agent-doc-rules to create a concise root AGENTS.md for this repository.
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Review stale README commands:
|
|
50
|
+
|
|
51
|
+
```text
|
|
52
|
+
Use $agent-doc-rules to review this README for stale commands and unsupported setup steps.
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Place facts from notes:
|
|
56
|
+
|
|
57
|
+
```text
|
|
58
|
+
Use $agent-doc-rules to move durable facts from notes.md into README, docs, AGENTS, or a project skill.
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Run factual review:
|
|
62
|
+
|
|
63
|
+
```text
|
|
64
|
+
Use $agent-doc-rules to review these docs for contradictions and unsupported claims.
|
|
65
|
+
```
|