root / AGENTS.md
AGENTS.md
Purpose
This file gives coding agents and contributors a compact, actionable guide for working in this repository.
Project Summary
This repository contains a Microsoft Edge extension that fetches Azure DevOps work items for a configured user using the current authenticated browser session and displays them in a side panel.
The project uses Vite as the build system. Source files live under src/, and extension artifacts are generated into dist/.
Source of Truth
README.mdis the human-facing project overview.AGENTS.mdis the agent-facing execution guide..specify/memory/constitution.mdis the planning constitution for future spec work..specify/commands/and.specify/skills/provide optional repo-local planning helpers layered on top of the Spec Kit templates.specs/holds promoted feature specs, andspecs/ideas/is the incubator for rough feature ideas before they are promoted.- Markdown documentation should include a breadcrumb path link line at the top that points back to the repository root
README.mdand the current document path when practical (for example,[root](./README.md) / AGENTS.md). The rootREADME.mditself is the exception and should not include a breadcrumb to itself. - In breadcrumb text and navigation labels, treat directory
README.mdfiles as implied like an index page: showsrc,src/devops, ortypes, notsrc/README.md. - Prefer repo-relative Markdown links for document navigation instead of plain path text when referencing other Markdown files.
- Source directories should include a local
README.mdthat explains the directory purpose, summarizes the same-level files, and links to child directory docs instead of duplicating nested details inline. - When project behavior, setup, configuration, file structure, or planning workflow changes, update
README.md,AGENTS.md, and the relevant.specify/specsdocs together in the same change whenever possible. - If there is a mismatch, prefer aligning both files rather than updating only one.
Working Agreement for Agents
- Keep changes minimal and targeted.
- Preserve the current architecture unless a change request requires restructuring.
- Keep the extension usable with the existing authenticated Azure DevOps session.
- Keep
src/content-script.tsas a generic runtime message bridge; place Azure DevOps-specific selectors, parsing, and API/domain logic undersrc/devops/modules. - Preserve the current service-worker/side-panel context flow:
src/service-worker.tsrecords the last visited Azure DevOps org/project and work-item URLs inchrome.storage.local, andsrc/sidepanel/App.tsxcan pin an active work-item context so work-item actions still work when the active tab is not Azure DevOps. - Keep exploratory feature notes in
specs/ideas/until goals, acceptance criteria, and sequencing are clear enough for a numbered feature spec. - Do not add secrets, tokens, or committed local configuration.
- Side panel React component files should use
PascalCase.tsx. - Side panel React component styles should live beside their components in
ComponentName.module.cssfiles and be imported asimport classes from './ComponentName.module.css';; when an element needs multiple classes, useclsxto compose them in JSX. - Side panel sections may add local
atoms/subdirectories for reusable interactive concepts and colocated*.test.ts/*.test.tsxcoverage; keep section layout files focused on composition rather than repeated row/button/control behavior. - Prefer moving side-panel stateful orchestration into section-local hooks or controller modules (for example
useSidepanelController.ts) soApp.tsxand card/layout components stay thin. - Utility/function modules should use
camelCase.ts. - When moving or renaming tracked files, use
git mvso history is preserved; do not create a new file and delete the old file as a substitute for a move. - Run
npm run lint,npm test, andnpm run buildafter non-trivial changes. - Respect the repository formatting rules in
.prettierrcand keep committed text files on LF line endings per.editorconfigand.gitattributes. - Prettier formatting issues are surfaced as ESLint warnings via
prettier/prettier; avoid manual formatting that introduces warnings likeDelete ␍,Insert ··, or indentation replacement diffs.
Repository Map
.specify/README.md+.specify/{commands,skills,memory,templates}/*— local Spec Kit planning helpers, project memory, and markdown templates for future planning workspecs/README.md+specs/ideas/README.md— promoted feature spec workspace plus the rough-idea incubatorsrc/manifest.json— extension manifest template copied to build outputsrc/service-worker.ts— extension startup/background behaviorsrc/content-script.ts— generic runtime message router between side panel and domain modulessrc/devops/*— Azure DevOps-specific DOM detection, URL/context parsing, REST/WIQL, and task/parent operationssrc/devops/{activeParentContext,lastVisitedContext}.ts— active work-item context resolution plus persisted last-visited org/project and work-item references used by the service worker fallback flowsrc/devops/workItems.ts— separate open/closed work-item query and transformation logic, including closed-date range filtering and parent-summary enrichmentsrc/sidepanel.html— side panel HTML entrysrc/sidepanel.tsx— React side panel entrysrc/sidepanel/{App,Tabs,Link,DebugConsolePane}.tsx+ matching*.module.cssfiles — side panel shell, tab chrome, link navigation helper, and in-panel debug log viewersrc/sidepanel/navigateToWorkItem.ts— shared Azure DevOps work-item navigation helper used by links and task buttons to reuse matching tabs when possiblesrc/sidepanel/{atoms,useSidepanelController}.ts*— shared shell atoms plus the side-panel orchestration hook used byApp.tsxsrc/sidepanel/workItemsDateRange.ts— default closed-date range and validation helpers for the Work items tabsrc/sidepanel/work-items/*+src/sidepanel/work-items/atoms/*— work-items tab layout plus smaller toolbar/date-range/row/group atoms and helper testssrc/sidepanel/work-item/*+src/sidepanel/work-item/atoms/*— active-item tab layout plus smaller task/suggestion/pin atoms and helper testssrc/sidepanel/settings/*— settings tab components (SettingsCard) with colocated*.module.cssfiles andindex.tsentry exportsrc/sidepanel/{chromeStorage,defaultSettings}.ts— side panel storage/defaults helpers, including cached work-items results plus browser-local closed-date range and parent-detail toggle statesrc/sidepanel/tabMessaging/index.ts+src/sidepanel/tabMessaging/*.ts— side panel tab messaging barrel + function modulessrc/devops/*.test.ts+src/sidepanel/tabMessaging/*.test.ts/*.test.tsx— Vitest unit tests (globals enabled)types/*.ts— shared extension types imported via the@/typesalias, including theWorkItemsQueryrequest/range typesvite.config.ts— Vite multi-entry build config for extension outputdist/— generated unpacked extension files (build output)README.md— user/developer documentationAGENTS.md— agent instructions
Configuration Rules
- Runtime settings should stay in browser storage unless explicitly changed.
- Persisted side-panel state in
src/sidepanel/chromeStorage.ts(for example cached work items, closed-date range and parent-detail toggle preferences, hidden child-task state filters, parent suggestions, active tab, pinned active work-item context, and collapsed recent-features state) should remain browser-local and backwards-compatible when storage shapes or keys change. - Local-only development configuration must not be committed.
- Avoid hardcoding organization, project, user names, tokens, or URLs that should remain configurable.
- Prefer deriving organization/project from the last visited
dev.azure.com/{organization}/{project}URL when settings are empty. - Treat an empty
assignedTosetting as the current signed-in Azure DevOps user (@me) when querying work items; explicit saved values remain overrides. - Preserve the
todoStatesarray so custom Azure DevOps states stay available for the TODO section alongside the default To Do/In Progress filter. organization,project, and user-specific fields (for exampleassignedTo) may be persisted in settings as explicit overrides.
Change Guidelines
When making changes:
- Update only the files required for the task.
- Preserve existing user-visible behavior unless the task requests a behavior change.
- If UI text, setup steps, configuration, permissions, or workflow changes, review
README.md. - If implementation conventions or agent instructions change, review
AGENTS.md. - If either document becomes inaccurate because of the change, update both.
- For file moves/renames, use
git mvto keep file history and diffs clean. - When adding, moving, or restructuring Markdown documents, update their breadcrumb path links in the same change.
- When adding a meaningful source directory, add or update its local
README.mdand keep parent directory docs linking to that child directory doc instead of expanding nested file lists inline. - When a planned feature changes scope or sequencing, update the relevant idea/spec artifacts in
specs/before or with the implementation change.
Validation Checklist
Before finishing a change, verify:
- The extension still loads as an unpacked Edge extension from
dist/. - Manifest entries remain consistent with the generated implementation.
- Side panel flow still works from the browser context.
- Azure DevOps requests still rely on the active authenticated session.
- Documentation reflects the current behavior and file structure.
- Linting passes with
npm run lint(or intentionally reported warnings are explained). - Tests pass with
npm test(or intentionally reported failures are explained).
Documentation Maintenance Rule
Any pull request or change that modifies one of the following should check and update both README.md and AGENTS.md as needed:
- project purpose
- setup/install steps
- configuration shape
- file structure
- extension permissions
- user workflow
- agent/contributor workflow
- markdown document navigation and breadcrumb conventions
- spec planning workflow or idea-to-spec promotion rules
Non-Goals
Unless explicitly requested, do not:
- add backend services
- require personal access tokens
- add complex tooling for a small change