From 23287831e3ee792629e7e671d4d699a1f7fcb4bd Mon Sep 17 00:00:00 2001 From: Julian Noble Date: Wed, 17 Jun 2026 19:31:05 +1000 Subject: [PATCH] initial AGENTS.md files --- AGENTS.md | 369 ++++++++++++++++++++++++++++++++----- src/lib/AGENTS.md | 10 + src/lib_tcl8/AGENTS.md | 5 + src/lib_tcl9/AGENTS.md | 5 + src/modules/AGENTS.md | 7 + src/modules_tcl8/AGENTS.md | 5 + src/modules_tcl9/AGENTS.md | 5 + 7 files changed, 358 insertions(+), 48 deletions(-) create mode 100644 src/lib/AGENTS.md create mode 100644 src/lib_tcl8/AGENTS.md create mode 100644 src/lib_tcl9/AGENTS.md create mode 100644 src/modules/AGENTS.md create mode 100644 src/modules_tcl8/AGENTS.md create mode 100644 src/modules_tcl9/AGENTS.md diff --git a/AGENTS.md b/AGENTS.md index bdda469d..ae1454cf 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,69 +1,226 @@ +# DOX framework + +- DOX is highly performant AGENTS.md hierarchy installed here +- Agent must follow DOX instructions across any edits + +## Core Contract + +- AGENTS.md files are binding work contracts for their subtrees +- Work products, source materials, instructions, records, assets, and durable docs must stay understandable from the nearest applicable AGENTS.md plus every parent AGENTS.md above it + +## Read Before Editing + +1. Read the root AGENTS.md +2. Identify every file or folder you expect to touch +3. Walk from the repository root to each target path +4. Read every AGENTS.md found along each route +5. If a parent AGENTS.md lists a child AGENTS.md whose scope contains the path, read that child and continue from there +6. Use the nearest AGENTS.md as the local contract and parent docs for repo-wide rules +7. If docs conflict, the closer doc controls local work details, but no child doc may weaken DOX + +Do not rely on memory. Re-read the applicable DOX chain in the current session before editing. + +## Update After Editing + +Every meaningful change requires a DOX pass before the task is done. + +Update the closest owning AGENTS.md when a change affects: + +- purpose, scope, ownership, or responsibilities +- durable structure, contracts, workflows, or operating rules +- required inputs, outputs, permissions, constraints, side effects, or artifacts +- user preferences about behavior, communication, process, organization, or quality +- AGENTS.md creation, deletion, move, rename, or index contents + +Update parent docs when parent-level structure, ownership, workflow, or child index changes. Update child docs when parent changes alter local rules. Remove stale or contradictory text immediately. Small edits that do not change behavior or contracts may leave docs unchanged, but the DOX pass still must happen. + +## Hierarchy + +- Root AGENTS.md is the DOX rail: project-wide instructions, global preferences, durable workflow rules, and the top-level Child DOX Index +- Child AGENTS.md files own domain-specific instructions and their own Child DOX Index +- Each parent explains what its direct children cover and what stays owned by the parent +- The closer a doc is to the work, the more specific and practical it must be + +## Child Doc Shape + +- Create a child AGENTS.md when a folder becomes a durable boundary with its own purpose, rules, responsibilities, workflow, materials, or quality standards +- Work Guidance must reflect the current standards of the project or user instructions; if there are no specific standards or instructions yet, leave it empty +- Verification must reflect an existing check; if no verification framework exists yet, leave it empty and update it when one exists + +Default section order: +- Purpose +- Ownership +- Local Contracts +- Work Guidance +- Verification +- Child DOX Index + +## Style + +- Keep docs concise, current, and operational +- Document stable contracts, not diary entries +- Put broad rules in parent docs and concrete details in child docs +- Prefer direct bullets with explicit names +- Do not duplicate rules across many files unless each scope needs a local version +- Delete stale notes instead of explaining history +- Trim obvious statements, repeated rules, misplaced detail, and warnings for risks that no longer exist + +## Closeout + +1. Re-check changed paths against the DOX chain +2. Update nearest owning docs and any affected parents or children +3. Refresh every affected Child DOX Index +4. Remove stale or contradictory text +5. Run existing verification when relevant +6. Report any docs intentionally left unchanged and why + +## User Preferences + +When the user requests a durable behavior change, record it here or in the relevant child AGENTS.md + +## Child DOX Index + +This project is not yet indexed. Before continuing you must scan the project, build the DOX tree and replace this message with the actual index. Go deep and scan files recursively to properly evaluate complexity and create nested DOX files where needed. + + + + # AGENTS.md -Agent handbook for the ShellSpy (Punk Shell) repository. These guidelines cover builds, linting, testing, code style, and day-to-day conventions for all contributors and agentic assistants. Always check for nested `AGENTS.md` files before editing subdirectories—this root spec applies repo-wide unless overridden deeper in the tree. +Agent handbook for the ShellSpy (Punk Shell) repository. These guidelines cover builds, linting, testing, code style, and day-to-day conventions for all contributors and agentic assistants. Always check for nested `AGENTS.md` files before editing subdirectories. This root spec applies repo-wide unless overridden deeper in the tree. + +if conflict with CLAUDE.md, AGENTS.md wins. ## Quickstart Checklist - Confirm Windows-friendly Tcl toolchain (8.6+ required, 9.0 supported). -- Run `tclsh make.tcl` once after cloning to populate generated assets. +- Run `tclsh src/make.tcl packages` once after cloning to populate generated assets. - Keep edits within the scoped instructions of any nested `AGENTS.md`. -- Use `tclint` before submitting code to align formatting and structure. -- Execute at least one relevant test script (`tclsh scriptlib/tests/.tcl`). +- Use `tclint` before submitting code to align formatting and structure for any new agent-produced code, but do not use it to reformat existing code. +- Execute at least one relevant test script (`tclsh src/tests//.tcl`). - Document changes impacting build, tooling, or developer workflow. ## Build & Bootstrap Commands -- **Primary build**: `tclsh make.tcl` (Windows default) or `punk make.tcl` inside Punk shell. -- **Alt entry point**: `punk build.tcl` or `tclsh build.tcl` for kettle-style builds. -- **Bootstrap shell**: `pmix KettleShell` from inside Punk shell for advanced packaging tasks. -- **Clean/resync**: Remove `build/` artifacts then rerun `tclsh make.tcl`; avoid partial cleans that break boot modules. -- **Binary images**: Use `punk make.tcl --target ` when producing platform-specific bundles (see script comments for targets). +- **Primary build**: `tclsh make.tcl project` (Windows default) or `punk902z make.tcl project` inside Punk shell. +- **Clean/resync**: Remove `_build/` artifacts then rerun `tclsh make.tcl project`; avoid partial cleans that break boot modules. Cleaning _build is generally not required. +- **Binary images**: Use `punk make.tcl project` to produce punk binaries. There are no platform-specific flags for cross-platform building - it must currently be done on each specific platform. The Tcl modules and libs are mostly cross-platform by nature, but the built binaries rely on platform specific runtimes and some binary packages from whichever src/vfs/*.vfs folder was used to build. ## Testing Strategy -- **Test location**: `scriptlib/tests/` holds all Tcl test scripts; keep new tests there. -- **Run entire suite**: Iterate with `for /r scriptlib\tests %f in (*.tcl) do tclsh %f` (Windows) or a similar shell loop on POSIX. -- **Run single test**: `tclsh scriptlib/tests/.tcl` (e.g., `tclsh scriptlib/tests/json.tcl`). +- **Test location**: `src/tests/` holds all Tcl test scripts; keep new tests there, named with the .test file extension. +- **Run entire suite**: Run base src/tests/runtests.tcl or Iterate with something like `for /r src\tests %f in (*.tcl) do tclsh %f` (Windows) or a similar shell loop on POSIX. +- **Run single test**: `tclsh src/tests//