This repository contains the Thand CLI, local agent, and server runtime for just-in-time access
management. It is a Go codebase with a separate nested test/ module for heavier functional and
integration suites, plus a Jekyll docs site under docs/.
- Entry point:
main.go->cmd/cli/ - CLI commands and local agent startup:
cmd/cli/ - Server and HTTP API handling:
internal/daemon/,internal/api/ - Config loading, environment wiring, provider/role/workflow registration:
internal/config/ - Provider integrations and RBAC logic:
internal/providers/<provider>/ - Workflow orchestration and DSL/runtime helpers:
internal/workflows/,sdk/workflows/ - Shared SDK types and constants:
sdk/ - Public examples and default config:
config.example.yaml,examples/ - Heavy test suites:
test/functional/,test/integration/ - Public docs and API docs:
docs/
Start by reading the files that define the repo's behavior instead of guessing:
README.mdMakefileconfig.example.yaml.github/workflows/test-and-build.yml- The nearest package README or docs page for the subsystem you are touching
If the task is not obviously local to one package, use the repo-orientation skill before editing.
- Keep changes architecture-aware: config loading belongs in
internal/config, provider behavior ininternal/providers/<provider>, workflow runtime behavior ininternal/workflows, and user-facing command behavior incmd/cli. - Preserve the existing provider pattern when adding or extending a provider: capability/schema/registration plus RBAC, session, and test coverage where applicable.
- Treat
examples/,config.example.yaml, anddocs/as part of the product. Keep them in sync with user-facing behavior. third_party/iam-datasetis a submodule used by data-generation flows. Do not update submodules unless the task actually requires it.- Prefer small, reviewable changes. Split release/versioning work from feature work.
- Prefer TDD-style verification for code changes when practical: add or update a failing test first, confirm it fails on the pre-change behavior, then implement the fix and rerun the targeted tests to confirm they pass.
- Do not install project-specific tools globally on the host.
- Prefer the documented workspace scripts and wiring in
docs/development/index.mdand the repo's documented commands inMakefile,README.md,docs/README.md, andRELEASE.mdover ad hoc environment setup. - Keep generated environment files out of tracked repos unless they are intentional workspace assets.
- Prefer symlinks, mounts and editable installs over copying code between repos.
- Never commit absolute paths that point into a user's home directory or other non-standard machine-local paths.
- For committed file references, prefer repo-relative paths whenever possible.
- Use the
temporal-developmentskill for Temporal Workflow Definitions, Activities, local activities, message handlers, versioning, and replay-sensitive changes. - Keep Workflow Definitions deterministic and side-effect free, keep external I/O in Activities, and treat replay compatibility as a rollout concern instead of a local refactor.
- For security-sensitive or privileged-access workflow changes, use
risky-access-change-reviewalongsidetemporal-development.
There is no dedicated repo lint target today. Default to gofmt plus the smallest relevant test
commands that match CI behavior.
- Format changed Go files with
gofmt -w. - Root Go module verification:
go test ./... - Functional tests:
cd test && go test -v -timeout 10m ./functional/... - Services integration:
cd test && go test -v -timeout 5m ./integration/services/... - Workflow integration:
cd test && go test -v -timeout 15m ./integration/workflows/... - Frontend E2E:
make build-linux-amd64thencd test && go test -v -timeout 30m ./integration/frontend/... - Docs site:
cd docs && bundle exec jekyll build - Swagger/API artifacts after API annotation changes:
make swagger - FlatBuffers/IAM dataset regeneration only when schema or generator inputs change:
make generate-data
Notes:
- CI uses Go
1.26andGOEXPERIMENT=jsonv2; match that when reproducing build or release behavior. - Frontend, functional, and many integration tests depend on Docker/testcontainers. Frontend E2E also expects Chromium on Linux in CI.
- The
test/directory is its own Go module. Rootgo test ./...does not replace the nestedtest/suites. - If a change touches Temporal Workflow Definitions or message handlers, add replay testing and
workflowcheckto the verification plan when practical, and say plainly if either was skipped.
This repo handles privileged access. Treat the following as high-risk surfaces:
- auth, login, and session state
- provider grant/revoke logic
- role/workflow resolution
- Temporal configuration, worker registration, and retry/idempotency boundaries
- service install/update flows
- config loading, env var overrides, and secret handling
- public API or CLI behavior
For high-risk changes:
- review both grant and revoke paths, not just the happy path
- check least-privilege impact and audit/logging coverage
- avoid leaking credentials or sensitive data in logs, examples, docs, or tests
- verify failure and retry behavior, especially around Temporal activities/workflows
- use
.github/PULL_REQUEST_TEMPLATE.mdas a practical review checklist
If the task is a review or security-sensitive implementation, use the risky-access-change-review
skill.
A normal change is done when:
- The code and nearby tests are updated coherently.
- Relevant examples, docs, config, or generated artifacts are updated when public behavior changed.
- The smallest meaningful verification commands have been run.
- Any skipped verification is called out explicitly.
- No debug-only code, secrets, or temporary workarounds remain.
Use skills for multi-step procedures instead of expanding this file:
repo-orientationverify-changeprovider-or-workflow-changepublic-surface-changerisky-access-change-reviewtemporal-development
Canonical skill sources live in .agent-shared/skills/. If you update shared skill text, run
scripts/sync-agent-skills.sh to refresh the generated Codex and Claude copies.