feat(bluecraft-agentic-docs): add agentic docs skill templates

Add the Bluecraft Agentic Docs skill with guidance for maintaining
root `AGENTS.md` files and `agent-docs/` trees.

Include OpenAI agent metadata plus reference templates and checklists
for root routing, rule docs, inventory docs, and refactor validation.
This commit is contained in:
2026-03-19 15:00:56 +08:00
parent 2c09e66106
commit 8d704cf406
8 changed files with 356 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
# Child `agent-docs/` Template Chooser
Use this reference when you know you are editing a Markdown file inside `agent-docs/`, but you still need to decide which child template fits.
## Choose The Smallest Matching Template
- Use `rule-doc-template.md` for instructions, constraints, policy, decision criteria, or workflow guidance.
- Use `inventory-doc-template.md` for maintained lists, media plans, registries, page-by-page backlogs, or cleanup queues.
- Split the document if one file tries to serve both purposes and the split would reduce ambiguity.
## Quick Tests
- If the document mainly tells maintainers what to do and what to avoid, use the rule template.
- If the document mainly tracks entries that need to be updated over time, use the inventory template.
- If the document has a long list of repeated entries under one governing policy, keep the policy brief and let the inventory structure carry the list.
## Compatibility Note
Older repositories may still refer to `references/child-doc-template.md` as the default child template. Keep this file as the entrypoint, but route new work to the specific template that matches the document's job.

View File

@@ -0,0 +1,54 @@
# Inventory `agent-docs/` Template
Use this structure for Markdown files inside `agent-docs/` when the document's main job is to track a maintained set of entries: media plans, per-page suggestions, registries, migration queues, or cleanup lists.
## Recommended Shape
```md
# <Document Title>
<Opening statement: what this inventory tracks, when it should be used or updated, and that it must be followed in scope.>
## Use This For
- <tasks that require reading or updating this inventory>
## Do Not Use This For
- <tasks that belong in a rule doc, public docs, or another inventory>
## Maintenance Rules
- <how to add, update, remove, or rewrite entries>
## Entries
### <Grouping Heading>
#### <Entry Title>
<Recommended fields; keep only the ones that materially help maintainers.>
Source:
- <path or owning document>
Status:
- <planned / in progress / complete / remove / optional>
Notes:
- <what to capture, why it matters, or what to clean up>
## Maintenance Checklist
- <questions for keeping the inventory current and unambiguous>
```
## Notes
- Prefer an inventory template when the document is mostly a maintained list rather than a rules essay.
- Start with a small field set. `Source`, `Status`, and `Notes` are common defaults, not mandatory fields.
- Add, rename, or remove entry fields to match the repository's actual maintenance needs.
- Keep entry fields stable enough within one document that maintainers can scan and update them consistently.
- Use grouping headings only when they materially improve navigation.
- Separate durable maintenance rules from the entries themselves.
- If the governing policy becomes large, move it to a rule doc and link to it from the inventory.

View File

@@ -0,0 +1,19 @@
# Refactor Checklist
Use this checklist after changing the root `AGENTS.md` or any file in `agent-docs/`.
- Does each covered document own one clear topic?
- Does each filename clearly express the document's purpose?
- Does each opening explain purpose, trigger, and that the document must be followed in scope?
- Is the `AGENTS.md` at the root of the current Git working tree still the primary routing entrypoint?
- Does every active `agent-docs/` file have an explicit path from the root?
- Does each child doc use the right shape for its job: rule doc versus inventory doc?
- Did you remove stale references, filenames, and replaced paths?
- Did you remove any orphan instruction docs created by the refactor?
- Did you avoid duplicating the same rule across multiple active docs?
- Did you avoid mixing long entry inventories into rule docs when a separate inventory would be clearer?
- Is the default path basis still the root of the current Git working tree unless explicitly overridden?
- Are repository-wide constraints still in the root file?
- Are topic-specific constraints still in child docs?
- Did you keep routing depth minimal?
- If the repository has a validation command, did you run it?

View File

@@ -0,0 +1,29 @@
# Root `AGENTS.md` Template
Use this structure for the `AGENTS.md` at the root of the current Git working tree.
## Recommended Shape
```md
# Root Entry
- State that this file is the primary routing entrypoint for the repository's agentic documentation tree.
- Define the default path basis.
# Common Constraints
- Keep repository-wide rules here.
- Do not repeat topic-specific rules that belong in child docs.
# Required Instructions Before Editing
- Route to the required child instruction docs.
- Use explicit "Read and follow ..." wording.
```
## Notes
- Keep this file short.
- Treat this file as an instruction document, not a passive index.
- Route to child docs only when they are actually needed.
- Do not turn the root file into a dump of all topic-specific rules.

View File

@@ -0,0 +1,56 @@
# Routing Patterns
## Preferred Patterns
### Root -> Topic Docs
Use when the repository has a small set of clearly separate instruction topics.
```md
# Required Instructions Before Editing
- Read and follow `agent-docs/topic-a.md` when ...
- Read and follow `agent-docs/topic-b.md` when ...
```
### Root -> Project Doc -> Leaf Docs
Use when one project-specific document can route to several closely related leaf docs.
```md
AGENTS.md
-> agent-docs/project-guidelines.md
-> agent-docs/topic-a.md
-> agent-docs/topic-b.md
```
Use this only when the intermediate layer reduces ambiguity or repeated routing text.
### Root -> Subproject `agent-docs/`
Use in monorepos when a subproject has its own scoped instruction set.
```md
AGENTS.md
-> apps/docs/agent-docs/project-guidelines.md
-> services/api/agent-docs/backend-guidelines.md
```
Common rules stay in the root `AGENTS.md`. Subproject-specific rules stay near the subproject they govern.
## Anti-Patterns
- Root file linking to every leaf doc in a large tree without grouping
- Child docs that are never reachable from the root
- Topic-specific rules stored in the root file without a routing reason
- Extra index files that only restate links without adding scope or decision logic
- Moving rules out of the root file without leaving an explicit route to the new child file
- Keeping monorepo-wide and subproject-specific constraints mixed together in the same root section when they can be separated cleanly
## Routing Rule
Parent documents should point to the child documents that refine them.
If a child document exists and is active, there must be an explicit path from the root `AGENTS.md` to that document.
The root `AGENTS.md` should route only to the next instruction documents that are actually needed. Do not add unnecessary next-step links just for completeness.

View File

@@ -0,0 +1,35 @@
# Rule `agent-docs/` Template
Use this structure for Markdown files inside `agent-docs/` when the document's main job is to govern behavior: rules, policy, constraints, decision criteria, or workflow guidance.
## Recommended Shape
```md
# <Document Title>
<Opening statement: what this doc governs, when it applies, and that it must be followed in scope.>
## Applies To
- <specific task or document types>
## Does Not Apply To
- <out-of-scope task or document types>
## <Rule Section>
- <instructions>
## Checklist
- <validation questions>
```
## Notes
- Make the scope explicit.
- Keep the document responsible for one topic.
- Use semantic filenames and headings.
- State the user or maintainer decision directly: what to do, what to avoid, and how to choose.
- Prefer linking to inventories, examples, or narrower child docs instead of embedding long registries inline.