You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: AGENTS.md
+10-1Lines changed: 10 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ It stores strict project rules that define architecture policy including:
9
9
- code patterns
10
10
- custom strict rules
11
11
12
-
Based on the target project, stack modules are combined into a single root`AGENTS.md` via the appropriate skill. It assembles project-specific rules while preserving shared conventions.
12
+
Based on the target project, stack modules are combined into root and nested`AGENTS.md`files via the appropriate skill when subprojects need more specific policy. It assembles project-specific rules while preserving shared conventions.
13
13
14
14
# Folder Structure
15
15
Current repository layout:
@@ -28,6 +28,8 @@ Current repository layout:
28
28
SKILL.md
29
29
modules/ # stack-specific guidance
30
30
<module-name>/doc.md
31
+
<subproject>/
32
+
AGENTS.md # nested policy for a specific app/service/package
31
33
```
32
34
33
35
# Root AGENTS.md rules
@@ -41,12 +43,18 @@ Current repository layout:
41
43
-`doc.md` must include references to all baseline and stack modules.
42
44
-`doc.md` must provide a canonical table with short stack key, full stack name, module path, and `load_when`.
43
45
-`doc.md` must instruct agents to always load baseline modules and load project-specific stacks by `load_when` signals.
46
+
-`doc.md` must define when to create nested `AGENTS.md` files and how parent/child precedence works.
44
47
-`doc.md` must define section semantics: `Strict rules` for technical constraints, and `Working Agreements` for user-agent interaction protocol.
45
48
-`doc.md` must define how to load and enforce `awesome/index.md` and matching awesome files.
46
49
- Changes to module paths or routing signals must update `doc.md` in the same change.
47
50
- When adding a new stack, update `doc.md` with both the short stack key and full stack name.
48
51
- Root `doc.md` should contain only routing/composition logic and helpers to assemble target `AGENTS.md`.
49
52
53
+
## Target Output
54
+
- Target repositories may contain a root `AGENTS.md` plus nested `AGENTS.md` files for subprojects with distinct stack, runtime, or ownership boundaries.
55
+
- Root `AGENTS.md` should stay repository-wide; nested `AGENTS.md` files should narrow rules for their subtree.
56
+
- Nested `AGENTS.md` files should be created only for meaningful architecture boundaries such as apps, services, or packages with distinct tooling.
57
+
50
58
## Stack
51
59
- Stack-specific guidance is maintained in `modules/*/doc.md`.
52
60
- Enforced stack or capability libraries/utilities are maintained in `awesome/*`.
@@ -57,6 +65,7 @@ Current repository layout:
57
65
## Skills
58
66
- Skills are maintained in `skills/<skill-name>/SKILL.md`.
59
67
- Skills must treat `doc.md` and `awesome/index.md` as the source of truth and must not introduce alternate router filenames.
68
+
- Skills must support root and nested `AGENTS.md` output when the repository contains multiple app or service boundaries.
60
69
- Skills that initialize from scratch or refactor existing repositories must run an architecture interview before selecting modules or refactoring code.
61
70
- Skills must wait for explicit `Accept` before writing `AGENTS.md` or performing architecture-driven refactors.
62
71
- Skills that mutate an existing codebase must propose a phased plan before editing files.
-`skills/<skill-name>/SKILL.md`: operational skills for greenfield init, AGENTS refresh, and guided refactors.
21
21
22
+
## Nested AGENTS.md
23
+
24
+
Target repositories may use a root `AGENTS.md` plus nested `AGENTS.md` files when different subprojects need more specific stack rules.
25
+
26
+
Example:
27
+
28
+
```text
29
+
<repo-root>/
30
+
AGENTS.md
31
+
frontend/
32
+
AGENTS.md
33
+
package.json
34
+
backend/
35
+
AGENTS.md
36
+
go.mod
37
+
```
38
+
39
+
Use nested files for meaningful architecture boundaries such as apps, services, or packages with distinct tooling. The nearest `AGENTS.md` should apply to the active subtree, while parent files stay additive for shared rules.
40
+
22
41
## Skill Workflows
23
42
24
43
Use the skill that matches the repository stage.
@@ -28,21 +47,21 @@ Use the skill that matches the repository stage.
`Use https://github.com/RevoTale/agent-docs/skills/init-project-from-agent-docs skill to design the initial AGENTS.md for this new repository.`
50
+
`Use https://github.com/RevoTale/agent-docs/skills/init-project-from-agent-docs skill to design the initial root and nested AGENTS.md files for this new repository.`
`Use https://github.com/RevoTale/agent-docs/skills/refresh-project-agents-from-agent-docs skill to refresh AGENTS.md for this repository.`
57
+
`Use https://github.com/RevoTale/agent-docs/skills/refresh-project-agents-from-agent-docs skill to refresh the root and nested AGENTS.md files for this repository.`
`Use https://github.com/RevoTale/agent-docs/skills/refactor-project-to-agent-docs skill to align this repository with the recommended stack after an architecture interview.`
64
+
`Use https://github.com/RevoTale/agent-docs/skills/refactor-project-to-agent-docs skill to align this repository and its nested subprojects with the recommended stack after an architecture interview.`
Copy file name to clipboardExpand all lines: doc.md
+23-1Lines changed: 23 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Overview
2
2
This file is the universal AGENTS router and composition contract.
3
-
It defines which module files to load and how to merge them into a target repository `AGENTS.md`.
3
+
It defines which module files to load and how to merge them into target repository `AGENTS.md` files.
4
4
5
5
# Canonical Module Registry
6
6
Use this table as the single source of truth for module routing.
@@ -21,6 +21,16 @@ Use this table as the single source of truth for module routing.
21
21
3. If multiple modules match, load all matched modules.
22
22
4. Any module add/remove/rename or signal change must update this table in the same change.
23
23
24
+
# Nested AGENTS.md Output
25
+
- MUST create a root `AGENTS.md` for repository-wide topology, shared workflows, and cross-project constraints.
26
+
- MUST create nested `AGENTS.md` files for deployable apps, backend services, frontend apps, packages, or subprojects with distinct stack signals, runtime boundaries, or policy needs.
27
+
- MUST detect boundaries such as `frontend/`, `backend/`, `apps/*`, `services/*`, `packages/*`, or equivalent user-declared subprojects.
28
+
- MUST select modules and matching awesome files independently for each nested subproject.
29
+
- MUST apply the nearest `AGENTS.md` to files in its subtree.
30
+
- MUST keep parent `AGENTS.md` files additive for shared rules.
31
+
- MUST let the more specific nested `AGENTS.md` override parent rules when stack-specific or subtree-specific rules conflict.
32
+
- MUST NOT create nested `AGENTS.md` files for ordinary folders that do not introduce distinct architecture, tooling, runtime, or ownership rules.
33
+
24
34
# Awesome Registry
25
35
Use `awesome/index.md` as the entrypoint for enforced utility/library choices by stack or capability.
26
36
@@ -91,6 +101,18 @@ When merging two project structures, produce a union of paths and preserve `OR`
91
101
|bun.lock|bun.lockb
92
102
```
93
103
104
+
#### Example of nested project structures
105
+
```text
106
+
<monorepo-root>/
107
+
|AGENTS.md
108
+
|frontend/
109
+
| |AGENTS.md
110
+
| |package.json
111
+
|backend/
112
+
| |AGENTS.md
113
+
| |go.mod
114
+
```
115
+
94
116
### Strict rules
95
117
- MUST merge compatible requirements additively.
96
118
- MUST treat stack modules as higher priority than baseline modules when strict rules conflict.
Copy file name to clipboardExpand all lines: skills/init-project-from-agent-docs/SKILL.md
+15-11Lines changed: 15 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,37 +10,41 @@ Use this skill when the repository is empty or early-stage and the user wants th
10
10
## Workflow
11
11
12
12
1. Run a short architecture interview.
13
-
- Ask only the questions needed to choose architecture: app purpose, user-facing surfaces, runtime shape (`web app`, `API`, `worker`, `CLI`), data and storage, auth and identity, key integrations, deployment constraints, and any mandated technologies.
13
+
- Ask only the questions needed to choose architecture: app purpose, whether the repository is single-app or multi-app, user-facing surfaces, runtime shape (`web app`, `API`, `worker`, `CLI`), data and storage, auth and identity, key integrations, deployment constraints, and any mandated technologies.
14
14
- If an answer is missing but a safe default exists, state the assumption explicitly instead of blocking.
15
15
- If the repository already has substantial code or tooling, switch to `refresh-project-agents-from-agent-docs` or `refactor-project-to-agent-docs`.
16
16
17
17
2. Load the current policy source of truth.
18
18
- Resolve `doc.md` first, then `awesome/index.md`.
19
19
- Load always-on modules from `doc.md`.
20
-
- Load stack modules whose `load_when` conditions match the interview answers or any existing repository signals.
21
-
- Load matching awesome files by stack and capability.
20
+
- Detect meaningful subproject boundaries such as `frontend/`, `backend/`, `apps/*`, `services/*`, `packages/*`, or user-declared app and service directories.
21
+
- Load stack modules whose `load_when` conditions match the interview answers or the signals for each subproject boundary.
22
+
- Load matching awesome files by stack and capability for the root and each nested subproject.
22
23
- Do not hardcode technology names when the router or awesome registry can decide them.
23
24
24
25
3. Propose the initial architecture before writing.
25
26
- Summarize the project brief in 3-6 bullets.
26
-
- Show selected modules and why they match.
27
-
- Show selected awesome capabilities and the required libraries they imply.
28
-
- Draft the target `AGENTS.md` structure with `Overview`, `Base Policy Links (Load First)`, and `Local Details`.
27
+
- Show the proposed repository topology, including whether nested `AGENTS.md` files are needed.
28
+
- Show selected modules and why they match for the root and each nested subproject.
29
+
- Show selected awesome capabilities and the required libraries they imply for each boundary.
30
+
- Draft the target `AGENTS.md` structure for the root and any nested subprojects with `Overview`, `Base Policy Links (Load First)`, and `Local Details`.
31
+
- Explain that the nearest `AGENTS.md` applies to a subtree while parent files stay additive for shared rules.
29
32
- Call out assumptions, open questions, and non-default choices.
30
33
31
34
4. Wait for explicit approval.
32
35
- Ask for explicit `Accept` before creating or updating `AGENTS.md` or suggesting code scaffolding.
33
36
- If the user changes scope, revise the proposal and ask again.
34
37
35
-
5. Write the initial `AGENTS.md`.
36
-
- Create a repository-specific `Overview`.
37
-
- Add links to `doc.md`, `awesome/index.md`, always-on modules, and matched stack modules.
38
+
5. Write the initial `AGENTS.md` files.
39
+
- Create a repository-specific root `Overview`.
40
+
- Add links to `doc.md`, `awesome/index.md`, always-on modules, and matched stack modules for the root and each nested subproject.
38
41
- Use latest default-branch links unless the user asked for commit-pinned links.
39
-
- Keep `Local Details`limited to project-specific constraints, decisions, and approved exceptions.
42
+
- Keep root `Local Details`focused on shared constraints and keep nested `Local Details` focused on subtree-specific constraints, decisions, and approved exceptions.
40
43
- Do not inline module policy text when links are sufficient.
41
44
- Do not copy awesome registry tables into the target `AGENTS.md`.
42
45
43
46
6. Validate and report.
44
47
- Confirm every linked file exists in the selected `agent-docs` revision.
45
-
- Report which router, module, and awesome files were selected and why.
48
+
- Report which root and nested `AGENTS.md` files were created and why those boundaries were chosen.
49
+
- Report which router, module, and awesome files were selected for each boundary.
46
50
- Report any assumptions that still need user confirmation.
Copy file name to clipboardExpand all lines: skills/refactor-project-to-agent-docs/SKILL.md
+12-10Lines changed: 12 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,36 +20,38 @@ Use this workflow when the goal is to align an existing project with `agent-docs
20
20
## Workflow
21
21
22
22
1. Run the architecture interview.
23
-
- Capture app purpose, critical flows, runtime surfaces, data and storage, auth and identity, integrations, deployment constraints, mandated technologies, and allowed migration risk.
23
+
- Capture app purpose, whether the repository is single-app or multi-app, critical flows, runtime surfaces, data and storage, auth and identity, integrations, deployment constraints, mandated technologies, and allowed migration risk.
24
24
- Separate what may change now from what must stay stable.
25
25
- If the repository intent is already documented, confirm it instead of re-asking everything.
26
26
27
27
2. Load the current `agent-docs` source of truth.
28
28
- Resolve `doc.md` first, then `awesome/index.md`.
- Use repository signals and interview answers together to choose the target architecture.
29
+
- Detect app and service boundaries such as `frontend/`, `backend/`, `apps/*`, `services/*`, `packages/*`, or equivalent user-declared subprojects.
30
+
- Load always-on modules, matched stack modules, and matching awesome files for the root and each subtree.
31
+
- Use repository signals and interview answers together to choose the target architecture for each subtree.
31
32
- Treat the current repository `AGENTS.md` as local input to preserve valid repository-specific exceptions, not as the router source of truth.
32
33
33
34
3. Audit the target project against policy.
34
-
- Inspect structure, dependency and runtime setup, task runner config, lint and format config, tests, build entrypoints, and major code patterns.
35
-
- Identify mismatches between current project state and loaded policy rules.
35
+
- Inspect structure, dependency and runtime setup, task runner config, lint and format config, tests, build entrypoints, and major code patterns for the root and each subtree.
36
+
- Identify mismatches between current project state and loaded policy rules per subtree.
36
37
- Capture baseline command results for lint, test, and build when those commands exist.
37
38
38
39
4. Propose the target architecture and plan.
39
-
- Summarize selected modules, awesome capabilities, and required library or tooling changes.
40
+
- Summarize selected modules, awesome capabilities, and required library or tooling changes for the root and each nested subproject.
41
+
- Explain where nested `AGENTS.md` files are required and how nearest-file precedence applies to each subtree.
40
42
- Output an ordered phase plan with goals, impacted files, risks, validations, and rollback notes for risky steps.
41
-
- Cover at minimum: structure, task runner/tasks, linting/formatting, code-style normalization, dependency alignment, and `AGENTS.md` updates.
43
+
- Cover at minimum: structure, task runner/tasks, linting/formatting, code-style normalization, dependency alignment, and root plus nested `AGENTS.md` updates.
42
44
- Ask for explicit `Accept` before editing.
43
45
44
46
5. Execute by phase.
45
47
- Refactor structure to the approved policy-aligned layout and naming.
46
48
- Refactor automation and tasking to match expected workflow patterns.
47
49
- Refactor lint, format, and dependency setup to the approved stack and capability choices.
48
-
- Refactor code style and architecture incrementally while preserving approved behavior.
49
-
- Update `AGENTS.md` and developer documentation so commands and rules remain accurate.
50
+
- Refactor code style and architecture incrementally per subtree while preserving approved behavior.
51
+
- Update root and nested `AGENTS.md` files and developer documentation so commands and rules remain accurate.
50
52
51
53
6. Verify `agent-docs` compliance.
52
-
- Build a rule-by-rule checklist from the loaded modules and awesome files.
54
+
- Build a rule-by-rule checklist from the loaded modules and awesome files for the root and each subtree.
53
55
- Mark each rule as `pass`, `fail`, or `not-applicable` with file or command evidence.
0 commit comments