Imported from ara3d/ara3d-webgl (
AGENTS.md). Install upstream withnpx skills add ara3d/ara3d-webgl. Copyright stays with the author.
Agent roles for Ara 3D WebGL
@ara3d/ara3d-webgl: WebGL viewer for large architectural (BIM) models on Three.js; primary format BIM Open Schema (.BOS). Pick the role that fits the task.
src/ library (loader, viewer). TypeScript.
examples/ example HTML/JS; add new demos here
docs/ build output for GitHub Pages demo site (npm run build:docs); do not edit by hand
work/ agent task logs: work/agents/<id>--<type>--<slug>/
Shared conventions (all roles)
- TypeScript in
src/; examples use JS andimport * as ARA3D from '../src/index'. - Use project ESLint and Prettier (
npm run eslint). Match existing patterns. - Public API = exports from
src/index.ts; avoid breaking or unnecessary changes. - After changes:
npm run build(orbuild:lib/build:docsas relevant) must succeed. - Do not edit
docs/by hand; it is build output for the GitHub Pages demo site (https://ara3d.github.io/ara3d-webgl/).
Branch, worktree, and agent work logs (required)
Branch naming (required)
Create a new branch for every task. Use:
feat/<slug>for new featuresfix/<slug>for bug fixesdocs/<slug>for documentation-only workperf/<slug>for performance improvementsrefactor/<slug>for non-behavior refactorschore/<slug>for build/tooling/maintenance
<slug> must be kebab-case, short (3–8 words), and descriptive.
Examples:
feat/room-parameter-grid-hoverfix/tabulator-cell-edited-callbackdocs/add-bos-loader-example
Do not work directly on main.
Worktrees (strongly recommended for parallel agents)
If using worktrees, create one worktree per task/branch.
Worktree folder location
- Preferred:
../wt/<branch-with-slashes-replaced-by-dashes>/- Example: branch
feat/room-parameter-grid-hover→../wt/feat-room-parameter-grid-hover/
- Example: branch
Do not reuse a worktree for a different task.
Agent work log folder (required)
Every task must create a work log folder under:
work/agents/<id>--<type>--<slug>/
Where:
<id>isYYYY-MM-DD(or issue number if applicable)<type>matches the branch prefix (feat,fix,docs, etc.)<slug>matches the branch slug
Examples:
work/agents/2026-02-09--feat--room-parameter-grid-hover/work/agents/2026-02-09--fix--tabulator-cell-edited-callback/
Required files in the folder:
task.md— the task packet as received (verbatim)plan.md— the plan produced before codingdecisions.md— key decisions/tradeoffs and whycommit-map.md— map commits to intent (see template below)
Optional files:
status.md— checklist/progress + “what remains”notes.md— investigation notes, links to relevant files, etc.
Work log templates (copy/paste)
task.md
- Paste the task instructions verbatim from the user / lead dev.
- If missing info, add a small “Questions/Assumptions” section at the bottom.
plan.md — Use the structure in work/templates/plan.md. For how to discover and order steps, see work/PLANNING.md.
decisions.md
- Bullet list of noteworthy decisions and tradeoffs in implementation and architecture
- What was chosen
- Alternatives considered
- Pros/cons of choice and alternatives
- Planned next steps
commit-map.md (example)
<hash>—chore: add work log + plan scaffolding<hash>—feat: implement <core change><hash>—docs/examples: add demo + update index/vite inputs<hash>—chore: lint/format + minor polish
Writing plan.md (required before implementation)
For any task that touches src/ or adds an example: write and commit plan.md (and the other required work log files) before writing implementation code. Use the structure in work/templates/plan.md and the methodology in work/PLANNING.md. When coding, follow the implementation steps in plan.md in order; if you deviate, update plan.md and decisions.md with the reason.
Commit milestones (required)
Make commits at these “smart times”:
-
Planning checkpoint (required)
- Create the work log folder and add
task.md+plan.md(and optionallystatus.md). - Commit message:
chore: add agent work log and plan (<slug>)
- Create the work log folder and add
-
First working code checkpoint (required)
- After the first end-to-end working implementation (even if minimal).
- Commit message:
feat: initial working implementation (<slug>)- or
fix: initial fix (<slug>)
-
Finalization checkpoint (required)
- After lint/build/tests pass and the demo site build/examples are updated as needed.
- Update
decisions.md+commit-map.md. - Commit message:
chore: finalize (<slug>)
Guidelines:
- Keep commits logically grouped; avoid “mega commits”.
- Do not commit broken builds or failing lint/tests unless explicitly asked.
- Do not rebase/squash unless the lead dev requests it.
- Implementation steps in
plan.mdare the intended order; follow them. If you deviate, updateplan.mdanddecisions.md.
Handoff / Definition of Done (before PR)
Before opening a PR (or handing off for review), ensure:
npm run buildsucceeds (orbuild:lib/build:docsfor the demo site as relevant)npm run eslintsucceeds- Modified examples smoke-test in the browser (if applicable)
- Work log folder exists with required files updated
commit-map.mdmatches the actual commit history- Scope adhered to: no drive-by refactors; public API unchanged unless asked
Role 1: Example creator
When: Add a new example (new .html demo, new demo flow).
Scope: New HTML under examples/ (e.g. example-<name>.html); reuse examples/style.css and ARA3D import; keep runnable via npm run dev.
Checklist:
- Create example in
examples/(+ any example-specific JS/CSS). - Add sidebar entry in
examples/index.html(#exampleList). - Register in
vite.config.docs.jsunderbuild.rollupOptions.input. - Use same asset base path as other examples (
/ara3d-webgl/for the deployed GitHub Pages demo site). - Run
npm run build:docsand confirm the demo site build and example listing.
Do not: Change src/index.ts or add library features.
Role 2: Feature developer
When: Implement a new library feature (loader option, viewer capability, new export).
Scope: Code under src/; export from src/index.ts when part of public API; types via npm run gentypes (part of build:lib).
Checklist:
- Implement in correct module; follow existing patterns (loader interface, viewer lifecycle).
- Export from
src/index.tsif public API. - Add or update examples if the feature needs a demo (follow Example creator steps for new pages).
- Run
npm run build:libandnpm run build:docsif examples changed; runnpm run eslint.
Do not: Refactor unrelated code; keep changes minimal and focused.
Role 3: Code improver
When: Improve existing code—bugs, performance, structure, naming, style. No new product features.
Scope: Edit src/ (and examples/ when relevant); preserve public API and behavior unless the task says otherwise; prefer small, reviewable steps.
Checklist:
- Bugs: Reproduce, then smallest fix; avoid mixing in refactors.
- Performance: Measure before/after where possible; note what changed.
- Structure/style: Same behavior and API; improve readability and project style.
- Run
npm run build,npm run eslint, and smoke-test affected examples.
Do not: Add new features or new examples; use Feature developer or Example creator.
Role 4: Software architect
When: Design and planning—structure for a new subsystem/feature, evaluate alternatives, plan refactors, document architecture.
Scope: Produce design artifacts only: architecture notes, ADRs, refactor plans, module-boundary docs. Optional small PoC snippets. Put artifacts in project root or a folder like architecture/ (e.g. ADR-001-*.md). Do not put them in docs/—that folder is build output for the GitHub Pages demo site. No large implementation; hand off to Feature developer or Code improver.
Checklist:
- Understand relevant
src/modules, public API, dependencies. - Write concise design/plan: options, recommendation, next steps for implementers.
- For ADRs: context, decision, consequences.
- Address only what was asked; don’t redesign unrelated areas.
Do not: Implement full features or refactors; don’t change build config or add examples unless the design requires it.
Role 5: API documentation
When: Add or update API docs for the public surface—exports from src/index.ts, main types, and key usage.
Scope: JSDoc/TSDoc in src/ for public APIs. Describe parameters, return types, and brief usage; link related symbols. If the project generates API docs, that output is part of build:docs. Do not put hand-written API markdown in docs/—that folder is build output for the GitHub Pages demo site. Do not change behavior or add features.
Checklist:
- Align with current
src/index.tsexports and types; document new or undocumented public entries. - Use consistent style with existing comments; keep descriptions concise.
- If generating API docs, ensure the doc build (e.g. as part of
build:docs) still runs and reflects changes. - Run
npm run build(and doc generation if applicable) to verify.
Do not: Modify implementation logic, add exports, or change the public API surface.