AGENTS.md Generator
Generate operational agent rules from repository facts and confirmed policy. Keep roots short, place local rules near scope, preserve human text, and verify writes.
Route
- Explicit AGENTS creation, update, compression, review, or repair enters the full workflow even when the root is healthy.
- A current-workspace planning request first checks root and global AGENTS state. If the managed root is healthy, report that result and return to the user's task; otherwise report the exact defect and continue to design or takeover.
- Use
read_only for explanation/planning/state checks/review; design for policy collection; write for approved changes; governance_high_risk for release/merge. None authorizes a non-testing subagent; only a current-task proactive explicit user request naming the role/purpose does.
- If the user explicitly asks for Codex Token usage statistics, use registry instruction
detect.token-usage-review; do not enter the AGENTS design interview. Use it only when the configured agent sessions directory exists, and keep any sessions-root override inside that active sessions tree.
- External work folders call the installed skill runtime. Only this owner repository uses repo-local
python skills/agents-md-generator/scripts/python/... paths.
- If no registered task route matches the requested task, stop unmatched tasks until agents.md/profile is updated; then update the current work folder AGENTS.md/profile before continuing.
- When skill development must link a code-hosting repository, use the configured existing-checkout contract: complete versioned release and installation first, then mirror, plan, and review only the local checkout; tools do not create remote repositories or push.
Inspect
- Read applicable AGENTS files, the latest handoff, memory, and repository governance.
- Use registry instructions
detect.inspect-project and detect.detect-scopes.
- Resolve the selected platform from
config/agent.json, then check its configured global instruction file for the managed baseline and version. For Codex, that file is $CODEX_HOME/AGENTS.md; verify it before relying on user-level rules.
- Treat missing metadata as a full-design trigger. Use takeover only for a version-mismatched old workspace with landed content.
- For strong-control work, pass
memory-gate; bootstrap exact-cwd Codex sessions when required.
- When codebase-memory MCP is enabled, require a ready
full persistent index, successful architecture analysis, root-only artifacts, and matching live/disk counts before writes.
The configured global file supplies the active baseline: scope, managed entry, reuse, rating, plans, opt-in subagents, one TESTER for tests/**, dual language preflight, docs, safety, install protection, and formulas. Local governance owns thresholds, layouts, exceptions, long tasks, and releases; roots inherit Coding Behavior Baseline. Review contradictions before <proposed_plan>; ask only when scope, security, cost, or external behavior changes.
Design
Use registry instruction design.collect-profile, resume unfinished state, and submit one returned group at a time.
- Ask every returned question and show its options. Do not infer mandatory answers; use the configured question identifiers and option sets.
- The configured
default_conversation_language governs all natural-language replies, including Plan Mode <proposed_plan> content, unless the user switches languages.
- Skill and Engineering development groups come from the selected profile; never copy a current question list into source or comments.
- After each group, show
review_summary and confirmed_so_far, then obtain confirmation. Record extra_requirements, including explicit none, and require final alignment.
- Read-only intent ends with
answers_snapshot and profile_preview; it creates no design review. Write intent also defaults to no review subagent. Enter design_review only after the user explicitly requests a review subagent and the hashes, findings, and confirmations validate; record reviewer_type="subagent" only for that authorized review.
--answers ... --write rejects missing mandatory answers, alignment, extra requirements, or directory policy. When explicit review evidence is supplied, validate it rather than making it a default prerequisite.
- Approved design reviews must bind
reviewed_answers_hash and reviewed_profile_hash to the current answers and profile before write.
- If remote servers are enabled, require configured
erie-remote-ssh, explicit routes, checked primary/fallback servers, and workspace checks; resolve and fail closed at runtime.
- Detect an installed skill from its directory and root
SKILL.md; keep CLI and settings discovery separate, and retain the runtime entry with a compatibility fallback.
- Remote structure governance is separate from remote-server enablement and task-route mapping. Validate relative conda/runtime/archive templates and reject traversal, wildcards, unsafe shell characters, empty values, and repeated separators.
- If codebase-memory MCP is requested but unavailable, provide manual installation guidance, never download or execute the installer automatically, and require restart before resuming.
- The design interview's
use_codebase_memory_mcp (55) choice controls the official MCP gate; enabled writes require a ready full persistent root-only index, while missing dependencies require manual installation guidance and restart.
Generate
- Run structure, branch, directory, memory, and codebase-memory gates required by the profile.
- Use registry instruction
render.render-agents; preview first and write only after approval.
- Preserve text outside
AGENTS-GENERATED blocks. Templates define root and scoped shape; do not absorb legacy evolution templates.
- Keep the root an operational index. Put detailed remote registries in
.agents/agents-control.json, directory policy in docs/dir_manager/planned_structure.json, and configurable coding/output rules in .agents/global-rule-overrides.json.
- Create scoped AGENTS only for verified local differences. Do not restate inherited root rules.
- Keep
.settings/ as work-folder configuration; allow remote .settings/*.remote.json and never copy .settings/*.local.json, including .settings/server_list.local.json, to remote systems.
For a confirmed platform, read config/agent.json and its catalog before writing; render the configured instruction files and create only the selected state directory. Generate the configured native metadata; installation keeps the selected profile and resolved configuration/docs. Non-default migration requires the configured migration options and confirmation; retire only a managed prior-selection marker.
README illustration contract
When a user asks this skill to update a skill README, reuse suitable existing visuals first. Create new artwork only when the user explicitly requests new visuals or the repository has no suitable asset; treat that request as a functional design deliverable, not as a decorative image task:
- Write a visual brief from the skill's real inputs, decisions, outputs, gates, and boundaries before generating anything.
- If new artwork is explicitly requested, use Image2/ImageGen to generate original raster artwork. SVG is forbidden as a README illustration; Mermaid is also forbidden in the public image assets.
- Make the main image a horizontal 16:9 overview that is legible in a repository README. Add style-consistent detail images for each major capability instead of repeating or cropping the hero.
- Use panels, tables, relationship maps, code fragments, state cards, or formulas only when they clarify the function. Avoid generic stock imagery, empty neon decoration, and a linear checklist with no functional information.
- Provide matching English and Chinese PNGs when the skill has bilingual READMEs, keep them local under
assets/readme/, and reference every image from the README that explains it.
- Validate PNG signatures, dimensions, local paths, and absence of SVG/remote metadata before copying new images into the source package or
dist/. Existing illustrations must not be redrawn merely to refresh README copy.
Source README is authoritative; versioned dist/ and existing github/ checkouts consume it and never become alternate sources. Illustrations stay local PNGs; the header may retain shields.io metadata links.
Roots render shared, python, script routes once: Python uses readable-python-generator; bat/cmd, shell/bash, PowerShell, Tcl, Node-only JavaScript (.js/.mjs), and static Dockerfile use readable-script-generator; wrappers remain script targets; browser JavaScript and Docker daemon/build stay out. Preserve separation; reject one-line/obfuscated code; load output policy from config.
Safety
- Do not invent commands, paths, owners, frameworks, CI rules, security policies, or coverage targets.
- Keep every proposed solution and plan inside the frozen user goal. Include only requested behavior, minimal integration, and current mandatory gates; mark every speculative feature, refactor, abstraction, compatibility layer, optimization, or configuration as out of scope unless the user explicitly reopens the boundary.
- Formal plans must be detailed enough to execute without additional design questions: name exact steps, inputs, outputs, files or interfaces, preconditions, failure handling, checks, and stop conditions. Use prose, tables, Mermaid, or a combination only where each form improves comprehension.
- Do not dispatch non-testing subagents by default. Only a proactive current-task request naming the role/purpose authorizes one; generic multi-agent, complexity, rating, risk, or judgment requests do not. If count is omitted, use exactly three; an explicit count overrides it and authorization never carries into another task.
- Canonical workers are narrow governance roles, not arbitrary subagents; automatic authorization requires Codex-native support, a managed root, explicit
enabled state, and a matching event. Missing state is unconfigured and blocks; session state cannot authorize.
- Test ownership follows project authorization: when tester is disabled, the main Agent owns
tests/**; when tester is explicitly enabled, use exactly one isolated fork_turns=none TESTER. Pure read-only or planning work and documentation-only changes without a test surface do not require test ownership.
- Only that TESTER may inspect, change, or run
tests/**; gardener may read/list it for design evidence but never edits/deletes/runs tests. For RED/BLOCKED/SCOPE_REJECTED, TESTER must return failure_report with failure_stage, failure_kind, first_error, failure_summary, failure_count, failure_tests, expected_actual, root_cause_class, minimal_fix, evidence, residual_jobs, and modification_status; each failure item needs test_id, expected, actual, observed, and source. A bare count is invalid. Main changes product; tester revalidates. Use authoritative evidence and stop on provenance conflict.
- New test files use functional or behavioral semantic names; filename stems must not contain version, case, or sequence literals. Do not bulk-rename existing tests.
- Every managed root renders one
Workspace boundary rule. Bound work-folder/codebase-memory refreshes need no extra confirmation; remote changes require the exact route. Reads are allowed, but other external writes require exact target disclosure, risk/recovery disclosure, and exactly one user confirmation; target/scope changes invalidate it.
- Canonical tester/reviewer/gardener roles are available only when
config/agent.json resolves a catalog profile with the configured native-worker capability; profile/tool paths come from its configured user-home directory. They preserve refresh backups and retain tests/** ownership and reviewer checkpoints. Other platforms do not claim these roles.
- Gardener reports use
schema_version=1 with fixed findings/rejection/uncertainty/verdict fields. AST zero-call function_candidates are never deletion conclusions; corroborate graph, exports, dynamic references, tests, and Markdown before a user decision. Markdown edits or public/dynamic/test-dependent deletions require confirmation.
- A single-task authorization receipt is confirmed once across the skill, AGENTS.md, and CLI; reuse it for the same target and scope, and re-confirm only when the target, scope, or material risk changes.
- Generated roots always include a state-aware, fail-closed remote work-folder contract: resolve the exact configured route and verified workspace, and keep deployment, conda/runtime, backup, and archive lifecycle details in
docs/dir_manager/planned_structure.json.
- Remote upload is manifest-only: never upload the whole work folder or a bundle;
.git/, git/, github/, dist/, and ref/ are forbidden, and selected directories must be expanded and hashed. New tests use tests/<feature>/test_<behavior>.<ext>.
allowed_root_files governs root-level exceptions. Root-level files outside the governed primary project root require review; allow the conservative structure-fix attempt only after explicit confirmation, then rerun structure-gate.
- Before local directory create/move/delete/rename, follow registry instruction
dirs.manage in review mode. A blocked result stops by default; force-confirmed work archives prior governance before mutation.
- Except for
__init__.py and __main__.py, functional source and Python test file stems use lowercase English functional words, never start with _, contain no digits, and stay within 30 characters. Deterministic checks do not replace the required Agent semantic review evidence.
- Keep exactly one
tests/ at the work-folder root. Root Python is limited to tests/__init__.py; place tests one level below by function as tests/<feature>/*.py, and never create nested tests/ directories.
remote_deployment.protected_path_classes and require_review_for_all_mutations=true govern remote changes; every remote create, move, delete, or rename must keep both source and target paths inside the governed remote plan, report path classes, and block protected destructive actions by default.
- Do not deploy skill-development content to remote systems unless explicitly authorized; deploy only named runtime artifacts.
- Keep
/.codebase-memory/ ignored and root-only. Ask before removing tracked entries from the Git index; preserve local files.
- Always obtain exactly one explicit user confirmation before installing, replacing, or directly modifying an installed skill, even when the action appears necessary for the current task.
Docs And Memory
- Before new work, follow the lifecycle commands below; repair an interrupted session before continuing, then start a session after reading the latest handoff.
- Document registration is an optional gate. Enter it only when the user explicitly requests document registration or document-governance migration; otherwise report it as skipped and do not create its governance state.
- For an opted-in skill, use registry instruction
registry.document-governance to scan, initialize, check, and finalize the document catalog, knowledge pointers, interface mappings, and duplicate adjudications. Markdown remains authoritative; uncertain adjudications require explicit user confirmation.
- Use
docs/memory/ for long-term context. Do not recreate the removed evolution or experience subsystems.
memory-compress creates a bounded retrieval view; the SQLite/JSONL sources remain authoritative.
- At completion, write
docs/handoff/HANDOFF.md. Archive older handoffs under history_handoff/HANDOFF-YYYYMMDD-HHMMSS[-N].md; repair naming drift explicitly.
- Keep install, Git/release, and directory governance under their existing
docs/ owners. Do not duplicate those manuals in AGENTS.md.
Verify
The skill document keeps two outer command groups. The first is the managed lifecycle:
python skills/agents-md-generator/scripts/python/docs/manage_docs.py resume-check .
python skills/agents-md-generator/scripts/python/docs/manage_docs.py memory-gate .
python skills/agents-md-generator/scripts/python/docs/manage_docs.py start-session . --input <session.json>
python skills/agents-md-generator/scripts/python/docs/manage_docs.py handoff . --input <handoff.json>
The second is the validation chain. Run the smallest relevant checks while editing, then the applicable final chain:
python skills/agents-md-generator/scripts/python/verify/quick_validate.py skills/agents-md-generator
python -m pytest -q
python -m unittest discover -s tests -t . -v
python skills/agents-md-generator/scripts/python/verify/audit_skill.py skills/agents-md-generator
python skills/agents-md-generator/scripts/python/verify/verify_agents.py . --installed-skill-dir skills/agents-md-generator
python skills/agents-md-generator/scripts/python/docs/manage_docs.py verify .
python skills/agents-md-generator/scripts/python/verify/evaluate_skill.py skills/agents-md-generator .
Canonical worker coordination uses workers/manage_workers.py dispatch-start,
dispatch-check, and dispatch-record; these commands emit one JSON object and
never call spawn_agent themselves. worker_dispatch.py is the single source
for event IDs, session state, target reuse, task envelopes, and fail-closed
unconfigured handling.
Release/install require one complete schema-2 pytest receipt: runner=pytest, suite=full, selector-free python -m pytest -q, counts, current tests/source SHA-256, test commit, and self-hash. Location never changes acceptance; schema-1/non-pytest receipts are history only. The gate also checks AGENTS freshness, manifest/cache exclusions, versioned dist parity, and install_skill.py --target skip.
For release/merge risk run review_governance.py; changed functional source or Python tests require --semantic-review <evidence.json> with matching base/head, changed-path hash, summaries, and pass verdicts. For aggregate evidence run run_confidence_gate.py; for formal effectiveness run run_skill_evals.py. Release packaging, installation, commit, push, and remote mutation require explicit scope; never claim an unrun check passed.
More Usage
Detailed command syntax, examples, prerequisites, outputs, exit codes, and risk boundaries live in config/registry/ and its generated SQLite FTS5 index. Ask the local registry instead of expanding this document:
python skills/agents-md-generator/scripts/python/registry/query_registry.py ask "<question>" [--kind <kind>] [--category <name>] [--limit 1..10] [--json]
The query is read-only and never executes returned commands. Exit codes are 0 for hits, 1 for no match, 2 for request errors, and 3 for a missing, corrupt, stale, or incompatible index. Rebuild after JSON changes with registry instruction registry.build.
Resources
references/script-guide.md: compact command entry and registry query contract.
references/review-checklist.md: review and verification gates.
references/skill-design-coverage.md: design-pattern and progressive-disclosure map.
references/coding-behavior-language-routing.md: language routing owner.
references/script-output-policy.md: process-output policy.
references/evaluation-scenarios.md: regression scenarios.
references/github-skill-release.md: existing-repository checkout, dist mirror, plan, and remote-publication boundaries.
references/public-skill-package.md: required public files and PNG-only bilingual README contract.
assets/templates/: generated Markdown shapes.
1---2name: agents-md-generator3description: Use when creating, updating, compressing, reviewing, or verifying AGENTS.md and other AI coding-agent rules; when a managed root AGENTS.md is missing, malformed, stale, or version-incompatible; when the user explicitly mentions AGENTS.md, agent rules, or scoped AGENTS.md; when a managed skill README needs a functional illustration set; or when a request about the current workspace, repository, or work folder is a planning request and therefore requires a root AGENTS.md check first.4---56# AGENTS.md Generator78Generate operational agent rules from repository facts and confirmed policy. Keep roots short, place local rules near scope, preserve human text, and verify writes.910## Route1112- Explicit AGENTS creation, update, compression, review, or repair enters the full workflow even when the root is healthy.13- A current-workspace planning request first checks root and global AGENTS state. If the managed root is healthy, report that result and return to the user's task; otherwise report the exact defect and continue to design or takeover.14- Use `read_only` for explanation/planning/state checks/review; `design` for policy collection; `write` for approved changes; `governance_high_risk` for release/merge. None authorizes a non-testing subagent; only a current-task proactive explicit user request naming the role/purpose does.15- If the user explicitly asks for Codex Token usage statistics, use registry instruction `detect.token-usage-review`; do not enter the AGENTS design interview. Use it only when the configured agent sessions directory exists, and keep any sessions-root override inside that active sessions tree.16- External work folders call the installed skill runtime. Only this owner repository uses repo-local `python skills/agents-md-generator/scripts/python/...` paths.17- If no registered task route matches the requested task, stop unmatched tasks until agents.md/profile is updated; then update the current work folder AGENTS.md/profile before continuing.18- When skill development must link a code-hosting repository, use the configured existing-checkout contract: complete versioned release and installation first, then mirror, plan, and review only the local checkout; tools do not create remote repositories or push.1920## Inspect21221. Read applicable AGENTS files, the latest handoff, memory, and repository governance.232. Use registry instructions `detect.inspect-project` and `detect.detect-scopes`.243. Resolve the selected platform from `config/agent.json`, then check its configured global instruction file for the managed baseline and version. For Codex, that file is `$CODEX_HOME/AGENTS.md`; verify it before relying on user-level rules.254. Treat missing metadata as a full-design trigger. Use takeover only for a version-mismatched old workspace with landed content.265. For strong-control work, pass `memory-gate`; bootstrap exact-cwd Codex sessions when required.276. When codebase-memory MCP is enabled, require a ready `full` persistent index, successful architecture analysis, root-only artifacts, and matching live/disk counts before writes.2829The configured global file supplies the active baseline: scope, managed entry, reuse, rating, plans, opt-in subagents, one TESTER for `tests/**`, dual language preflight, docs, safety, install protection, and formulas. Local governance owns thresholds, layouts, exceptions, long tasks, and releases; roots inherit `Coding Behavior Baseline`. Review contradictions before `<proposed_plan>`; ask only when scope, security, cost, or external behavior changes.3031## Design3233Use registry instruction `design.collect-profile`, resume unfinished state, and submit one returned group at a time.3435- Ask every returned question and show its options. Do not infer mandatory answers; use the configured question identifiers and option sets.36- The configured `default_conversation_language` governs all natural-language replies, including Plan Mode `<proposed_plan>` content, unless the user switches languages.37- Skill and Engineering development groups come from the selected profile; never copy a current question list into source or comments.38- After each group, show `review_summary` and `confirmed_so_far`, then obtain confirmation. Record `extra_requirements`, including explicit `none`, and require final alignment.39- Read-only intent ends with `answers_snapshot` and `profile_preview`; it creates no design review. Write intent also defaults to no review subagent. Enter `design_review` only after the user explicitly requests a review subagent and the hashes, findings, and confirmations validate; record `reviewer_type="subagent"` only for that authorized review.40- `--answers ... --write` rejects missing mandatory answers, alignment, extra requirements, or directory policy. When explicit review evidence is supplied, validate it rather than making it a default prerequisite.41- Approved design reviews must bind `reviewed_answers_hash` and `reviewed_profile_hash` to the current answers and profile before write.42- If remote servers are enabled, require configured `erie-remote-ssh`, explicit routes, checked primary/fallback servers, and workspace checks; resolve and fail closed at runtime.43- Detect an installed skill from its directory and root `SKILL.md`; keep CLI and settings discovery separate, and retain the runtime entry with a compatibility fallback.44- Remote structure governance is separate from remote-server enablement and task-route mapping. Validate relative conda/runtime/archive templates and reject traversal, wildcards, unsafe shell characters, empty values, and repeated separators.45- If codebase-memory MCP is requested but unavailable, provide manual installation guidance, never download or execute the installer automatically, and require restart before resuming.46- The design interview's `use_codebase_memory_mcp` (55) choice controls the official MCP gate; enabled writes require a ready full persistent root-only index, while missing dependencies require manual installation guidance and restart.4748## Generate49501. Run structure, branch, directory, memory, and codebase-memory gates required by the profile.512. Use registry instruction `render.render-agents`; preview first and write only after approval.523. Preserve text outside `AGENTS-GENERATED` blocks. Templates define root and scoped shape; do not absorb legacy evolution templates.534. Keep the root an operational index. Put detailed remote registries in `.agents/agents-control.json`, directory policy in `docs/dir_manager/planned_structure.json`, and configurable coding/output rules in `.agents/global-rule-overrides.json`.545. Create scoped AGENTS only for verified local differences. Do not restate inherited root rules.556. Keep `.settings/` as work-folder configuration; allow remote `.settings/*.remote.json` and never copy `.settings/*.local.json`, including `.settings/server_list.local.json`, to remote systems.5657For a confirmed platform, read `config/agent.json` and its catalog before writing; render the configured instruction files and create only the selected state directory. Generate the configured native metadata; installation keeps the selected profile and resolved configuration/docs. Non-default migration requires the configured migration options and confirmation; retire only a managed prior-selection marker.5859### README illustration contract6061When a user asks this skill to update a skill README, reuse suitable existing visuals first. Create new artwork only when the user explicitly requests new visuals or the repository has no suitable asset; treat that request as a functional design deliverable, not as a decorative image task:62631. Write a visual brief from the skill's real inputs, decisions, outputs, gates, and boundaries before generating anything.642. If new artwork is explicitly requested, use Image2/ImageGen to generate original raster artwork. SVG is forbidden as a README illustration; Mermaid is also forbidden in the public image assets.653. Make the main image a horizontal 16:9 overview that is legible in a repository README. Add style-consistent detail images for each major capability instead of repeating or cropping the hero.664. Use panels, tables, relationship maps, code fragments, state cards, or formulas only when they clarify the function. Avoid generic stock imagery, empty neon decoration, and a linear checklist with no functional information.675. Provide matching English and Chinese PNGs when the skill has bilingual READMEs, keep them local under `assets/readme/`, and reference every image from the README that explains it.686. Validate PNG signatures, dimensions, local paths, and absence of SVG/remote metadata before copying new images into the source package or `dist/`. Existing illustrations must not be redrawn merely to refresh README copy.6970Source README is authoritative; versioned `dist/` and existing `github/` checkouts consume it and never become alternate sources. Illustrations stay local PNGs; the header may retain shields.io metadata links.7172Roots render `shared`, `python`, `script` routes once: Python uses `readable-python-generator`; bat/cmd, shell/bash, PowerShell, Tcl, Node-only JavaScript (`.js`/`.mjs`), and static Dockerfile use `readable-script-generator`; wrappers remain script targets; browser JavaScript and Docker daemon/build stay out. Preserve separation; reject one-line/obfuscated code; load output policy from config.7374## Safety7576- Do not invent commands, paths, owners, frameworks, CI rules, security policies, or coverage targets.77- Keep every proposed solution and plan inside the frozen user goal. Include only requested behavior, minimal integration, and current mandatory gates; mark every speculative feature, refactor, abstraction, compatibility layer, optimization, or configuration as out of scope unless the user explicitly reopens the boundary.78- Formal plans must be detailed enough to execute without additional design questions: name exact steps, inputs, outputs, files or interfaces, preconditions, failure handling, checks, and stop conditions. Use prose, tables, Mermaid, or a combination only where each form improves comprehension.79- Do not dispatch non-testing subagents by default. Only a proactive current-task request naming the role/purpose authorizes one; generic multi-agent, complexity, rating, risk, or judgment requests do not. If count is omitted, use exactly three; an explicit count overrides it and authorization never carries into another task.80- Canonical workers are narrow governance roles, not arbitrary subagents; automatic authorization requires Codex-native support, a managed root, explicit `enabled` state, and a matching event. Missing state is `unconfigured` and blocks; session state cannot authorize.81- Test ownership follows project authorization: when tester is disabled, the main Agent owns `tests/**`; when tester is explicitly enabled, use exactly one isolated `fork_turns=none` TESTER. Pure read-only or planning work and documentation-only changes without a test surface do not require test ownership.82- Only that TESTER may inspect, change, or run `tests/**`; gardener may read/list it for design evidence but never edits/deletes/runs tests. For RED/BLOCKED/SCOPE_REJECTED, TESTER must return `failure_report` with `failure_stage`, `failure_kind`, `first_error`, `failure_summary`, `failure_count`, `failure_tests`, `expected_actual`, `root_cause_class`, `minimal_fix`, `evidence`, `residual_jobs`, and `modification_status`; each failure item needs `test_id`, `expected`, `actual`, `observed`, and `source`. A bare count is invalid. Main changes product; tester revalidates. Use authoritative evidence and stop on provenance conflict.83- New test files use functional or behavioral semantic names; filename stems must not contain version, case, or sequence literals. Do not bulk-rename existing tests.84- Every managed root renders one `Workspace boundary` rule. Bound work-folder/codebase-memory refreshes need no extra confirmation; remote changes require the exact route. Reads are allowed, but other external writes require exact target disclosure, risk/recovery disclosure, and exactly one user confirmation; target/scope changes invalidate it.85- Canonical tester/reviewer/gardener roles are available only when `config/agent.json` resolves a catalog profile with the configured native-worker capability; profile/tool paths come from its configured user-home directory. They preserve refresh backups and retain `tests/**` ownership and reviewer checkpoints. Other platforms do not claim these roles.86- Gardener reports use `schema_version=1` with fixed findings/rejection/uncertainty/verdict fields. AST zero-call `function_candidates` are never deletion conclusions; corroborate graph, exports, dynamic references, tests, and Markdown before a user decision. Markdown edits or public/dynamic/test-dependent deletions require confirmation.87- A single-task authorization receipt is confirmed once across the skill, AGENTS.md, and CLI; reuse it for the same target and scope, and re-confirm only when the target, scope, or material risk changes.88- Generated roots always include a state-aware, fail-closed remote work-folder contract: resolve the exact configured route and verified workspace, and keep deployment, conda/runtime, backup, and archive lifecycle details in `docs/dir_manager/planned_structure.json`.89- Remote upload is manifest-only: never upload the whole work folder or a bundle; `.git/`, `git/`, `github/`, `dist/`, and `ref/` are forbidden, and selected directories must be expanded and hashed. New tests use `tests/<feature>/test_<behavior>.<ext>`.90- `allowed_root_files` governs root-level exceptions. Root-level files outside the governed primary project root require review; allow the conservative structure-fix attempt only after explicit confirmation, then rerun `structure-gate`.91- Before local directory create/move/delete/rename, follow registry instruction `dirs.manage` in review mode. A blocked result stops by default; force-confirmed work archives prior governance before mutation.92- Except for `__init__.py` and `__main__.py`, functional source and Python test file stems use lowercase English functional words, never start with `_`, contain no digits, and stay within 30 characters. Deterministic checks do not replace the required Agent semantic review evidence.93- Keep exactly one `tests/` at the work-folder root. Root Python is limited to `tests/__init__.py`; place tests one level below by function as `tests/<feature>/*.py`, and never create nested `tests/` directories.94- `remote_deployment.protected_path_classes` and `require_review_for_all_mutations=true` govern remote changes; every remote `create`, `move`, `delete`, or `rename` must keep both source and target paths inside the governed remote plan, report path classes, and block protected destructive actions by default.95- Do not deploy skill-development content to remote systems unless explicitly authorized; deploy only named runtime artifacts.96- Keep `/.codebase-memory/` ignored and root-only. Ask before removing tracked entries from the Git index; preserve local files.97- Always obtain exactly one explicit user confirmation before installing, replacing, or directly modifying an installed skill, even when the action appears necessary for the current task.9899## Docs And Memory100101- Before new work, follow the lifecycle commands below; repair an interrupted session before continuing, then start a session after reading the latest handoff.102- Document registration is an optional gate. Enter it only when the user explicitly requests document registration or document-governance migration; otherwise report it as skipped and do not create its governance state.103- For an opted-in skill, use registry instruction `registry.document-governance` to scan, initialize, check, and finalize the document catalog, knowledge pointers, interface mappings, and duplicate adjudications. Markdown remains authoritative; uncertain adjudications require explicit user confirmation.104- Use `docs/memory/` for long-term context. Do not recreate the removed evolution or experience subsystems.105- `memory-compress` creates a bounded retrieval view; the SQLite/JSONL sources remain authoritative.106- At completion, write `docs/handoff/HANDOFF.md`. Archive older handoffs under `history_handoff/HANDOFF-YYYYMMDD-HHMMSS[-N].md`; repair naming drift explicitly.107- Keep install, Git/release, and directory governance under their existing `docs/` owners. Do not duplicate those manuals in AGENTS.md.108109## Verify110111The skill document keeps two outer command groups. The first is the managed lifecycle:112113```text114python skills/agents-md-generator/scripts/python/docs/manage_docs.py resume-check .115python skills/agents-md-generator/scripts/python/docs/manage_docs.py memory-gate .116python skills/agents-md-generator/scripts/python/docs/manage_docs.py start-session . --input <session.json>117python skills/agents-md-generator/scripts/python/docs/manage_docs.py handoff . --input <handoff.json>118```119120The second is the validation chain. Run the smallest relevant checks while editing, then the applicable final chain:121122```text123python skills/agents-md-generator/scripts/python/verify/quick_validate.py skills/agents-md-generator124python -m pytest -q125python -m unittest discover -s tests -t . -v126python skills/agents-md-generator/scripts/python/verify/audit_skill.py skills/agents-md-generator127python skills/agents-md-generator/scripts/python/verify/verify_agents.py . --installed-skill-dir skills/agents-md-generator128python skills/agents-md-generator/scripts/python/docs/manage_docs.py verify .129python skills/agents-md-generator/scripts/python/verify/evaluate_skill.py skills/agents-md-generator .130```131132Canonical worker coordination uses `workers/manage_workers.py dispatch-start`,133`dispatch-check`, and `dispatch-record`; these commands emit one JSON object and134never call `spawn_agent` themselves. `worker_dispatch.py` is the single source135for event IDs, session state, target reuse, task envelopes, and fail-closed136`unconfigured` handling.137138Release/install require one complete schema-2 pytest receipt: `runner=pytest`, `suite=full`, selector-free `python -m pytest -q`, counts, current tests/source SHA-256, test commit, and self-hash. Location never changes acceptance; schema-1/non-pytest receipts are history only. The gate also checks AGENTS freshness, manifest/cache exclusions, versioned dist parity, and `install_skill.py --target skip`.139140For release/merge risk run `review_governance.py`; changed functional source or Python tests require `--semantic-review <evidence.json>` with matching base/head, changed-path hash, summaries, and pass verdicts. For aggregate evidence run `run_confidence_gate.py`; for formal effectiveness run `run_skill_evals.py`. Release packaging, installation, commit, push, and remote mutation require explicit scope; never claim an unrun check passed.141142## More Usage143144Detailed command syntax, examples, prerequisites, outputs, exit codes, and risk boundaries live in `config/registry/` and its generated SQLite FTS5 index. Ask the local registry instead of expanding this document:145146```text147python skills/agents-md-generator/scripts/python/registry/query_registry.py ask "<question>" [--kind <kind>] [--category <name>] [--limit 1..10] [--json]148```149150The query is read-only and never executes returned commands. Exit codes are `0` for hits, `1` for no match, `2` for request errors, and `3` for a missing, corrupt, stale, or incompatible index. Rebuild after JSON changes with registry instruction `registry.build`.151152## Resources153154- `references/script-guide.md`: compact command entry and registry query contract.155- `references/review-checklist.md`: review and verification gates.156- `references/skill-design-coverage.md`: design-pattern and progressive-disclosure map.157- `references/coding-behavior-language-routing.md`: language routing owner.158- `references/script-output-policy.md`: process-output policy.159- `references/evaluation-scenarios.md`: regression scenarios.160- `references/github-skill-release.md`: existing-repository checkout, dist mirror, plan, and remote-publication boundaries.161- `references/public-skill-package.md`: required public files and PNG-only bilingual README contract.162- `assets/templates/`: generated Markdown shapes.