agentsmd-hierarchy 1.0.0

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 ADDED
@@ -0,0 +1,212 @@
1
+ # AGENTS Hierarchy
2
+
3
+ > A sharp little CLI and installable skill bundle for keeping layered `AGENTS.md` docs accurate, readable, and in sync with your repo.
4
+
5
+ `agentsmd-hierarchy` packages two things together:
6
+
7
+ - A CLI for checking, scaffolding, and refreshing hierarchical `AGENTS.md` files
8
+ - An installable skill bundle you can drop into Codex, Claude Code, Cursor, or a Codex plugin directory
9
+
10
+ ## Why This Exists
11
+
12
+ Large repos get messy fast. `AGENTS.md` files work best when they behave like a map: each directory explains its immediate children, local writing rules, and how guidance cascades down the tree.
13
+
14
+ That keeps any single `AGENTS.md` lighter, which reduces context load and can improve model performance. It is useful for humans too, because the same hierarchy makes the project's structure easier to understand.
15
+
16
+ This package helps you keep that map healthy without hand-maintaining everything:
17
+
18
+ - Validate stale or malformed `AGENTS.md` files
19
+ - Scaffold missing docs for new directories
20
+ - Refresh inventory sections after the tree changes
21
+ - Install the skill where your agent tooling can actually use it
22
+
23
+ ## Works With
24
+
25
+ | Tool | Install Shape |
26
+ | ----------- | ----------------------------- |
27
+ | Codex | Skill bundle or plugin bundle |
28
+ | Claude Code | Skill bundle |
29
+ | Cursor | Command file |
30
+
31
+ ## Quick Start
32
+
33
+ If you just want to install it and go:
34
+
35
+ ```bash
36
+ npx -y agentsmd-hierarchy install
37
+ ```
38
+
39
+ That launches an interactive installer and lets you choose the target tool and scope.
40
+
41
+ If you prefer deterministic installs:
42
+
43
+ ```bash
44
+ npx -y agentsmd-hierarchy install --tool codex --scope personal --no-prompt
45
+ ```
46
+
47
+ If you want the command available on your `PATH`:
48
+
49
+ ```bash
50
+ npm install -g agentsmd-hierarchy
51
+ ```
52
+
53
+ ## Install Options
54
+
55
+ ### Personal install
56
+
57
+ ```bash
58
+ npx -y agentsmd-hierarchy install --tool codex --scope personal --no-prompt
59
+ ```
60
+
61
+ ```bash
62
+ npx -y agentsmd-hierarchy install --tool claude --scope personal --no-prompt
63
+ ```
64
+
65
+ ```bash
66
+ npx -y agentsmd-hierarchy install --tool cursor --scope personal --no-prompt
67
+ ```
68
+
69
+ ### Project install
70
+
71
+ Run this from inside a git repo, or pass `--project-root`.
72
+
73
+ ```bash
74
+ npx -y agentsmd-hierarchy install --tool codex --scope project --no-prompt
75
+ ```
76
+
77
+ ```bash
78
+ npx -y agentsmd-hierarchy install --tool claude --scope project --no-prompt
79
+ ```
80
+
81
+ ```bash
82
+ npx -y agentsmd-hierarchy install --tool cursor --scope project --no-prompt
83
+ ```
84
+
85
+ ### Export a Codex plugin bundle
86
+
87
+ ```bash
88
+ npx -y agentsmd-hierarchy install \
89
+ --tool codex \
90
+ --mode plugin \
91
+ --dest ./plugins/agentsmd-hierarchy \
92
+ --no-prompt
93
+ ```
94
+
95
+ ## CLI Commands
96
+
97
+ Once installed globally, or via `npx`, the main workflow looks like this:
98
+
99
+ ```bash
100
+ agentsmd-hierarchy check .
101
+ agentsmd-hierarchy fix .
102
+ agentsmd-hierarchy scaffold src/components
103
+ ```
104
+
105
+ ### `check [path]`
106
+
107
+ Validate `AGENTS.md` files without changing them.
108
+
109
+ ```bash
110
+ agentsmd-hierarchy check packages/app
111
+ agentsmd-hierarchy check . --strict-placeholders
112
+ ```
113
+
114
+ ### `fix [path]`
115
+
116
+ Refresh missing or stale `AGENTS.md` files.
117
+
118
+ ```bash
119
+ agentsmd-hierarchy fix .
120
+ agentsmd-hierarchy fix tests
121
+ ```
122
+
123
+ ### `sync [path]`
124
+
125
+ Compatibility alias for `fix`.
126
+
127
+ ```bash
128
+ agentsmd-hierarchy sync .
129
+ ```
130
+
131
+ ### `scaffold <dir>`
132
+
133
+ Create the first `AGENTS.md` for a repo-relative directory.
134
+
135
+ ```bash
136
+ agentsmd-hierarchy scaffold src/features/payments
137
+ ```
138
+
139
+ ### `install`
140
+
141
+ Install the packaged skill bundle into a supported tool.
142
+
143
+ ```bash
144
+ agentsmd-hierarchy install --tool codex --scope project --no-prompt
145
+ ```
146
+
147
+ Helpful flags:
148
+
149
+ - `--debug` for structured troubleshooting output
150
+ - `--dry-run` to preview changes
151
+ - `--json` to emit install summaries as JSON
152
+ - `--force` to replace unmanaged destinations
153
+
154
+ ## What Gets Installed
155
+
156
+ Depending on the target, this package installs:
157
+
158
+ - A full skill bundle under `.codex/skills/agentsmd-hierarchy/`
159
+ - A full skill bundle under `.claude/skills/agentsmd-hierarchy/`
160
+ - A Cursor command file under `.cursor/commands/agentsmd-hierarchy.md`
161
+ - A Codex plugin bundle at the destination you choose
162
+
163
+ The shipped skill teaches agents to:
164
+
165
+ - Read the `AGENTS.md` chain from repo root to target path
166
+ - Treat each file as documentation for immediate children only
167
+ - Use bundled helpers to validate and scaffold docs deterministically
168
+ - Keep parent and child `AGENTS.md` files aligned as the tree evolves
169
+
170
+ ## Local Development
171
+
172
+ This repo ships the published package contents and the tests that back them.
173
+
174
+ ```bash
175
+ npm install
176
+ npm test
177
+ ```
178
+
179
+ The published npm package includes:
180
+
181
+ - `bin/` for the executable entrypoint
182
+ - `agentsmd-hierarchy/` for the distributable skill bundle and helper scripts
183
+
184
+ ## Releases
185
+
186
+ This repo uses Changesets for versioning and npm publishing.
187
+
188
+ Release steps:
189
+
190
+ 1. Run `npm run changeset` for each user-facing change and commit the resulting file under `.changeset/`.
191
+ 2. Merge those changesets to `main`.
192
+ 3. In GitHub, open `Actions` and run the `Release` workflow manually.
193
+ 4. Wait for the workflow to open or update the release PR with the version bump and changelog changes.
194
+ 5. Review and merge that release PR into `main`.
195
+ 6. In GitHub, run the `Release` workflow manually again from `main`.
196
+ 7. Wait for the workflow to publish the package to npm.
197
+
198
+ During publish, the workflow also creates the matching GitHub tag and GitHub Release automatically, so npm releases and GitHub releases stay aligned.
199
+
200
+ ## Requirements
201
+
202
+ - Node.js `>=20`
203
+
204
+ ## Contributing
205
+
206
+ Contribution PRs are welcome.
207
+
208
+ For user-facing changes, please include a Changeset by running `npm run changeset` and committing the generated file under `.changeset/` alongside your update.
209
+
210
+ ## License
211
+
212
+ MIT
@@ -0,0 +1,21 @@
1
+ # agentsmd-hierarchy
2
+
3
+ Distributable skill bundle for AGENTS Hierarchy, combining the main skill instructions with agent metadata, reference docs, and bundled helper scripts.
4
+
5
+ ## Directories
6
+
7
+ - `agents/`: Agent integration metadata for tool registries.
8
+ - `references/`: Convention docs and example AGENTS files that support the skill instructions.
9
+ - `scripts/`: Bundled helper CLIs and shared implementation used by the skill workflow.
10
+ Rules:
11
+ - Keep command entrypoints small and move reusable behavior into `scripts/lib/`.
12
+
13
+ ## Files
14
+
15
+ - `SKILL.md`: Primary skill instructions that describe the AGENTS hierarchy workflow and preferred bundled commands.
16
+
17
+ ## Writing Rules
18
+
19
+ - Keep `SKILL.md`, `agents/openai.yaml`, and the bundled scripts aligned so the documented workflow matches actual behavior.
20
+ - Put reusable CLI logic under `scripts/lib/` and reserve top-level script files for thin entrypoints or prompt helpers.
21
+ - Keep references focused on conventions and examples that the skill explicitly points users to.
@@ -0,0 +1,82 @@
1
+ ---
2
+ name: agentsmd-hierarchy
3
+ description: Navigate and maintain repositories that use hierarchical AGENTS.md files, where each directory AGENTS.md describes its immediate children, local writing rules, and cascading repo guidance. Use when Codex needs to understand a repo through AGENTS.md, follow AGENTS instructions before editing, or use repo CLI helpers to scaffold, sync, validate, or update AGENTS.md files after files or directories change.
4
+ ---
5
+
6
+ # AGENTS Hierarchy
7
+
8
+ ## Overview
9
+
10
+ Read `AGENTS.md` files as a layered map of the repository. Start at the repo root, walk down to the target path, use those files to decide what to open next, and keep the hierarchy current when the directory inventory changes.
11
+
12
+ ## Read the Chain
13
+
14
+ 1. Locate the repository root `AGENTS.md`.
15
+ 2. Read each `AGENTS.md` from root to the target directory in order.
16
+ 3. Apply parent guidance first, then let deeper `AGENTS.md` files narrow or override the rules for their own subtree.
17
+ 4. Use directory summaries and file bullets to decide which source files to inspect.
18
+ 5. When the target is a repo-local skill package, still read parent `AGENTS.md` files such as `.codex/AGENTS.md`; stop only because the skill package itself should not contain a nested `AGENTS.md`.
19
+
20
+ ## Interpret the Format
21
+
22
+ - Treat each `AGENTS.md` as documentation for that directory's immediate children only.
23
+ - Read `## Writing Rules` as the local policy for edits in that directory.
24
+ - Treat indented `Rules:` blocks under child bullets as the most specific guidance for that item.
25
+ - Use `## Generated Files` to spot artifacts that should usually be regenerated instead of hand-edited.
26
+ - Do not expect one `AGENTS.md` to fully describe grandchildren; walk deeper in the tree when needed.
27
+
28
+ ## Respect Skill Package Exceptions
29
+
30
+ - Do not add `AGENTS.md` files inside repo-local skill packages under `.codex/skills/` unless the repository explicitly asks for that pattern.
31
+ - Use `SKILL.md`, `agents/openai.yaml`, and `references/` as the documentation surface for a skill package.
32
+ - Treat the repo root `AGENTS.md` as enough context to discover that the repo contains local skills.
33
+
34
+ ## Update the Hierarchy
35
+
36
+ - Audit the directory's immediate tracked children before editing so `## Directories`, `## Files`, and `## Generated Files` reflect the current inventory.
37
+ - Prefer checking tracked paths with repository tooling such as `git ls-files` when available, then fall back to the filesystem when needed.
38
+ - Update the current directory `AGENTS.md` whenever immediate files or subdirectories are added, removed, renamed, or materially repurposed.
39
+ - Update the parent directory `AGENTS.md` when a child directory changes role or inventory.
40
+ - Keep descriptions brief, behavioral, and focused on why a file or directory exists.
41
+ - Keep file-specific rules inline on the relevant file bullet unless the repo explicitly wants the same rule duplicated in source comments.
42
+
43
+ ## Scaffold Carefully
44
+
45
+ - Prefer the bundled AGENTS tool first when a directory needs its first `AGENTS.md`; use manual drafting only when the helper does not fit the task.
46
+ - Use the bundled script path for the current skill package, such as `node .codex/skills/agentsmd-hierarchy/scripts/validate-agents.mjs --fix <repo-relative-directory>`.
47
+ - Replace placeholders with real summaries before considering the directory documented.
48
+ - Recheck the immediate child inventory before finishing so `## Directories`, `## Files`, and `## Generated Files` stay complete.
49
+
50
+ ## Use Repo Helpers
51
+
52
+ Treat the bundled CLI helpers in this skill package as part of the skill:
53
+
54
+ - Use [scripts/validate-agents.mjs](scripts/validate-agents.mjs) with `--check` to validate AGENTS structure, inventory correctness, and missing AGENTS.md files.
55
+ - Use [scripts/validate-agents.mjs](scripts/validate-agents.mjs) with `--fix` to scaffold missing AGENTS.md files and refresh inventory sections while preserving compatible descriptions and rules.
56
+ - Add `--debug` to these bundled scripts when you need extra visibility into repo-root resolution, inventory discovery, scope selection, or validation counts.
57
+ - Prefer these bundled scripts before recreating scaffold, sync, or validation logic manually.
58
+ - Use manual `AGENTS.md` edits to refine descriptions, rules, or edge cases around the script output, not to replace deterministic script work the helpers already cover.
59
+ - Let the bundled scripts read repo-specific inventory exclusions from the root `AGENTS.md` `## AGENTS Hierarchy` section when that section lists excluded paths.
60
+ - Run the bundled scripts from the repository root so they can treat the current working directory as the repo root by default.
61
+ - Do not assume the repository exposes package-manager wrappers such as `pnpm`, `npm`, or `yarn` scripts; use the bundled script path unless the user explicitly asks for a repo-local wrapper.
62
+ - Treat support modules in this directory, such as `scripts/cli-logger.mjs`, as internal implementation helpers for the CLIs rather than direct end-user commands.
63
+
64
+ ## Preferred CLI Workflow
65
+
66
+ 1. Read the AGENTS chain for the target path.
67
+ 2. Use the bundled AGENTS tool as the skill's default deterministic workflow whenever it covers the task.
68
+ 3. Use `node .codex/skills/agentsmd-hierarchy/scripts/validate-agents.mjs --fix <repo-relative-path>` after structural changes so missing AGENTS.md files are scaffolded and inventory sections match the current tree.
69
+ 4. Make any manual `AGENTS.md` edits that are still needed for descriptions, rules, or special cases the script cannot infer.
70
+ 5. Use `node .codex/skills/agentsmd-hierarchy/scripts/validate-agents.mjs --check <repo-relative-path-or-agents-file>` before finishing to verify the AGENTS structure, inventory, and required-file coverage deterministically.
71
+ 6. Add `--debug` to check or fix runs when you need the helper script to explain what it discovered and why it made a decision.
72
+
73
+ ## Load the Reference
74
+
75
+ Open [references/agents-convention.md](references/agents-convention.md) when you need the canonical section layout, update checklist, or generated-file guidance.
76
+
77
+ Open one of these example files when you want a concrete pattern to imitate:
78
+
79
+ - [references/example-simple-flat-directory.md](references/example-simple-flat-directory.md)
80
+ - [references/example-simple-test-helpers.md](references/example-simple-test-helpers.md)
81
+ - [references/example-complex-package-root.md](references/example-complex-package-root.md)
82
+ - [references/example-complex-source-directory.md](references/example-complex-source-directory.md)
@@ -0,0 +1,16 @@
1
+ # agentsmd-hierarchy/agents
2
+
3
+ Agent registry metadata for the skill bundle, used to present the skill name, summary, and default prompt in supported tools.
4
+
5
+ ## Directories
6
+
7
+ - None.
8
+
9
+ ## Files
10
+
11
+ - `openai.yaml`: OpenAI/Codex-facing metadata for the skill's display name, summary, and default prompt.
12
+
13
+ ## Writing Rules
14
+
15
+ - Keep metadata aligned with the name, scope, and workflow described in `../SKILL.md`.
16
+ - Prefer concise user-facing copy that reflects the actual bundled commands and behavior.
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: 'AGENTS Hierarchy'
3
+ short_description: 'Navigate and prefer bundled CLI helpers to scaffold, sync, validate, and maintain layered AGENTS.md files'
4
+ default_prompt: "Use $agentsmd-hierarchy to read this repository's AGENTS.md chain, follow the local rules, prefer the bundled or matching repo CLI helpers for scaffold, sync, and validation work before manual AGENTS editing, add --debug to those helper scripts when extra trace detail would help, then validate the result before finishing."
@@ -0,0 +1,20 @@
1
+ # agentsmd-hierarchy/references
2
+
3
+ Reference material that backs the skill instructions, including the canonical AGENTS convention and copy-pastable example layouts.
4
+
5
+ ## Directories
6
+
7
+ - None.
8
+
9
+ ## Files
10
+
11
+ - `agents-convention.md`: Canonical section layout, update checklist, and validation guidance for directory-level `AGENTS.md` files.
12
+ - `example-complex-package-root.md`: Example AGENTS file for a package root with child directories, config files, and generated artifacts.
13
+ - `example-complex-source-directory.md`: Example AGENTS file for a source subtree with generated files and file-specific rules.
14
+ - `example-simple-flat-directory.md`: Example AGENTS file for a small directory that only contains files.
15
+ - `example-simple-test-helpers.md`: Example AGENTS file for a compact helper-oriented test directory.
16
+
17
+ ## Writing Rules
18
+
19
+ - Keep the convention document aligned with the behavior enforced by the bundled validator.
20
+ - Keep example files small, valid Markdown, and clearly matched to the directory shape named in the filename.
@@ -0,0 +1,94 @@
1
+ # AGENTS Convention
2
+
3
+ ## Required Layout
4
+
5
+ Use this format for each directory-level `AGENTS.md`:
6
+
7
+ 1. `# <repo-relative-directory>`
8
+ 2. A brief overview paragraph
9
+ 3. `## Directories`
10
+ 4. `## Files`
11
+ 5. Optional `## Generated Files`
12
+ 6. `## Writing Rules`
13
+
14
+ Document only the directory's immediate children. Do not list grandchildren in the current file.
15
+
16
+ ## Section Rules
17
+
18
+ ### Directories
19
+
20
+ - Format each entry as `- \`name/\`: description`.
21
+ - When a child directory needs special handling, add an indented `Rules:` label below the bullet and list one or more rule bullets beneath it.
22
+ - Describe the child directory's purpose, not every file inside it.
23
+ - List only immediate child directories.
24
+
25
+ ### Files
26
+
27
+ - Format each entry as `- \`name.ext\`: description`.
28
+ - When a file needs special handling, add an indented `Rules:` label below the bullet and list one or more rule bullets beneath it.
29
+ - Exclude the local `AGENTS.md`.
30
+
31
+ ### Generated Files
32
+
33
+ - Use this section for tracked generated artifacts such as lockfiles, `*.gen.*` files, or packaged archives.
34
+ - State how the artifact should usually be refreshed.
35
+ - Keep generated-file rule bullets short and actionable.
36
+
37
+ ### Writing Rules
38
+
39
+ - Keep 2-6 concise bullets.
40
+ - Focus on how to edit files in the directory, not on general coding advice already covered higher in the tree.
41
+ - Avoid self-referential reminders about updating the `AGENTS.md`; use the bullets for concrete local editing guidance.
42
+
43
+ ## Cascading Behavior
44
+
45
+ - Read `AGENTS.md` files from root to leaf.
46
+ - Apply parent rules first.
47
+ - Let child `AGENTS.md` files add local detail or override the parent for their own subtree.
48
+ - Let child-bullet `Rules:` blocks win for that specific file or directory.
49
+
50
+ ## Skill Package Exception
51
+
52
+ - Do not add `AGENTS.md` inside repo-local skill packages under `.codex/skills/` unless the repository explicitly asks for that.
53
+ - Use `SKILL.md`, `agents/openai.yaml`, and `references/` to document skills instead.
54
+ - It is fine for a repo root `AGENTS.md` to mention `.codex/` or local skills at a high level without creating nested skill-package `AGENTS.md` files.
55
+
56
+ ## Update Checklist
57
+
58
+ Before editing, verify the directory's immediate tracked children so the file matches the current inventory. Prefer repository-aware listings such as `git ls-files` when available, then fall back to the filesystem for untracked local work.
59
+
60
+ Update a directory `AGENTS.md` when:
61
+
62
+ - A tracked file is added, removed, renamed, or materially repurposed.
63
+ - A subdirectory is added, removed, renamed, or materially repurposed.
64
+ - Local writing rules change.
65
+ - A file becomes generated or stops being generated.
66
+
67
+ Update the parent `AGENTS.md` too when the identity of a child directory changes.
68
+
69
+ ## Scaffolding Guidance
70
+
71
+ - Use the skill's bundled `scripts/scaffold-agents.mjs` helper or the repo's matching helper when it exists.
72
+ - Prefer the helper over hand-writing a first draft when the helper covers the task.
73
+ - Treat scaffold output as a draft, not finished documentation.
74
+ - Replace placeholder text before finishing the task.
75
+
76
+ ## Sync Guidance
77
+
78
+ - Use the skill's bundled `scripts/sync-agents.mjs` helper or the repo's matching helper when it exists to refresh `## Directories`, `## Files`, and `## Generated Files` from the current repo inventory.
79
+ - Prefer the helper over manually rebuilding inventory sections when the helper covers the task.
80
+ - Let sync and validation helpers read repo-specific excluded inventory paths from the root `AGENTS.md` `## AGENTS Hierarchy` section when that section lists exclusions.
81
+ - Let sync helpers preserve existing descriptions and writing rules when possible, then review any placeholder text they leave behind.
82
+
83
+ ## Validation Guidance
84
+
85
+ - Use the skill's bundled `scripts/validate-agents.mjs` helper or the repo's matching helper when it exists to check title, overview, section layout, entry formatting, writing-rule count, and AGENTS package exclusions.
86
+ - Prefer the validator over ad hoc manual checking so the skill ends with deterministic structure validation.
87
+ - Placeholder descriptions may remain when the task allows them; use stricter placeholder validation only when the repo or task requires finished descriptions.
88
+
89
+ ## Example Files
90
+
91
+ - For a small flat directory, open [example-simple-flat-directory.md](example-simple-flat-directory.md).
92
+ - For a small helper directory, open [example-simple-test-helpers.md](example-simple-test-helpers.md).
93
+ - For a package root with config, source, and generated files, open [example-complex-package-root.md](example-complex-package-root.md).
94
+ - For a source directory with generated artifacts and file-specific rules, open [example-complex-source-directory.md](example-complex-source-directory.md).
@@ -0,0 +1,37 @@
1
+ # Complex Example: Package Root
2
+
3
+ Use this example when a package root mixes config files, child directories, and tracked generated artifacts.
4
+
5
+ ```md
6
+ # packages/front
7
+
8
+ Frontend workspace for routes, components, static assets, and test tooling.
9
+
10
+ ## Directories
11
+
12
+ - `e2e/`: Playwright suites for real user journeys.
13
+ - `public/`: Static files served directly by the app.
14
+ - `src/`: Application code for routes, components, and shared libraries.
15
+
16
+ ## Files
17
+
18
+ - `.env.example`: Example frontend environment variables.
19
+ Rules:
20
+ - Keep it aligned with runtime env usage.
21
+ - `package.json`: Frontend package manifest and scripts.
22
+ Rules:
23
+ - Keep scripts aligned with Vite and Playwright config.
24
+ - `playwright.config.ts`: Playwright configuration for browser coverage.
25
+ - `vite.config.ts`: Vite dev and build configuration.
26
+
27
+ ## Generated Files
28
+
29
+ - `package-lock.json`: npm lockfile kept for tool compatibility.
30
+ Rules:
31
+ - Refresh with npm tooling instead of hand-editing.
32
+
33
+ ## Writing Rules
34
+
35
+ - Keep package-level tooling files at the root and product code under `src/`.
36
+ - Push feature-specific behavior into `src/` rather than package-level config files.
37
+ ```
@@ -0,0 +1,34 @@
1
+ # Complex Example: Source Directory with Generated Artifacts
2
+
3
+ Use this example when a source directory has child directories, authored files, generated files, and a few file-specific rules.
4
+
5
+ ```md
6
+ # packages/front/src
7
+
8
+ Frontend application source for route definitions, UI components, and bootstrapping.
9
+
10
+ ## Directories
11
+
12
+ - `components/`: Shared UI grouped by feature or abstraction level.
13
+ - `lib/`: Reusable app logic, API helpers, and route utilities.
14
+ - `routes/`: File-based route modules.
15
+
16
+ ## Files
17
+
18
+ - `router.tsx`: Router factory and router registration.
19
+ - `start.ts`: App bootstrap and server middleware wiring.
20
+ - `styles.css`: Global styles and design tokens.
21
+ Rules:
22
+ - Keep shared tokens centralized here instead of duplicating them in components.
23
+
24
+ ## Generated Files
25
+
26
+ - `routeTree.gen.ts`: Generated route tree.
27
+ Rules:
28
+ - Regenerate it through routing tooling instead of hand-editing.
29
+
30
+ ## Writing Rules
31
+
32
+ - Separate bootstrap, shared logic, components, and routes by responsibility.
33
+ - Treat generated router output as read-only.
34
+ ```
@@ -0,0 +1,23 @@
1
+ # Simple Example: Flat Utility Directory
2
+
3
+ Use this example when a directory has only files and no child directories.
4
+
5
+ ```md
6
+ # scripts
7
+
8
+ Helper scripts for local repo maintenance.
9
+
10
+ ## Directories
11
+
12
+ - None.
13
+
14
+ ## Files
15
+
16
+ - `rename-project.js`: Renames the project across package manifests and docs.
17
+ - `verify-preview.mjs`: Checks that the preview app responds on expected routes.
18
+
19
+ ## Writing Rules
20
+
21
+ - Keep scripts deterministic and safe to run from automation.
22
+ - Keep script names tied to the repo task they automate.
23
+ ```
@@ -0,0 +1,22 @@
1
+ # Simple Example: Test Helpers Directory
2
+
3
+ Use this example when a directory is small, focused, and mostly holds helper code for one part of the repo.
4
+
5
+ ```md
6
+ # packages/back/tests/helpers
7
+
8
+ Shared helpers used by backend test suites.
9
+
10
+ ## Directories
11
+
12
+ - None.
13
+
14
+ ## Files
15
+
16
+ - `integration.ts`: Creates reusable setup helpers for backend integration tests.
17
+
18
+ ## Writing Rules
19
+
20
+ - Keep helpers generic enough to serve multiple suites.
21
+ - Do not hide important assertions inside helper utilities.
22
+ ```
@@ -0,0 +1,21 @@
1
+ # agentsmd-hierarchy/scripts
2
+
3
+ Bundled CLI entrypoints and prompt helpers that support the skill's scaffold, sync, and validation workflow.
4
+
5
+ ## Directories
6
+
7
+ - `lib/`: Shared implementation for logging, install flows, command registration, and AGENTS validation logic.
8
+
9
+ ## Files
10
+
11
+ - `cli-logger.mjs`: Convenience re-export for the shared CLI logger implementation.
12
+ - `cli-prompts.mjs`: Shared prompt and path-resolution helpers for interactive command flows.
13
+ - `scaffold-agents.mjs`: CLI wrapper that scaffolds AGENTS files for a required repo-relative directory by delegating to the validator in fix mode.
14
+ - `sync-agents.mjs`: Compatibility CLI wrapper that defaults to sync behavior via validator fix mode.
15
+ - `validate-agents.mjs`: Direct CLI entrypoint for AGENTS validation and fix workflows.
16
+
17
+ ## Writing Rules
18
+
19
+ - Keep executable entrypoints thin and move reusable logic into `lib/`.
20
+ - Preserve repo-relative path handling and `--debug` passthrough across command wrappers.
21
+ - Keep interactive prompts centralized in `cli-prompts.mjs` instead of duplicating prompt logic in entrypoints.
@@ -0,0 +1 @@
1
+ export { createLogger } from './lib/cli-logger.mjs';