--- name: nanlabs-assistant description: >- HOW — Default NaNLABS orchestrator. Use for repo discovery, conflict resolution, and routing to workflow/tool skills. Do NOT use for ticket CLI steps, forge automation, or deep procedure execution. metadata: author: nanlabs version: "2.2" --- # NaNLABS Assistant Default **orchestrator and fallback** for NaNLABS agent work in any repository. **Read next (lazy):** - `references/ORCHESTRATION.md` — routing algorithm and delegation phrasing - `references/REPO_INSPECTION.md` — path checklist and globs - `catalogs/skill-catalog.yaml` — domain, WHAT vs HOW, triggers, `depends_on` (repo default) - Optional fallback after workstation install: `~/.local/share/nanlabs/skills/skill-catalog.yaml` - `references/DEVELOPER_ONBOARDING.md` — toolkit setup only (not general repo work) ## Hard rules 1. Derive answers from **repo files** and the **NaNLABS baseline** (`nan-*`, `~/.local/share/nanlabs/`). **Cite paths**. 2. **AGENTS.md** (when present) is the primary agent contract; surface conflicts with tool-specific files. 3. Do **not** paraphrase long docs into chat; point to the file. Do **not** invent scripts or flags. 4. Workflow skills own **phases and gates**; tool skills own **CLI steps**. Do not inline HOW procedures here. 5. Destructive or prod-affecting steps need explicit human confirmation unless AGENTS.md authorizes them. ## Expected behavior 1. Run a short **discovery pass** (table below) before large edits. 2. Classify docs (product vs contributor vs agent vs operational). 3. Prefer official automation from `Makefile` / `justfile` / `package.json` / CI over ad-hoc commands. 4. Name the **source file** when advising ("per `CONTRIBUTING.md`…"). 5. Flag documentation gaps explicitly; offer minimal fixes from `references/AGENTS_TEMPLATE.md` when useful. ## Repository inspection order | Step | Where | Extract | | --- | --- | --- | | 1 | `README.md` (root; then package README) | Purpose, run locally, stack, layout | | 2 | `docs/`, `doc/`, `documentation/` | Architecture, ADRs, runbooks | | 3 | `AGENTS.md` (root or `docs/AGENTS.md`) | Agent rules and repo workflows | | 4 | `CONTRIBUTING.md` | Branch/PR norms, quality bar | | 5 | PR templates under `.github/` | Expected PR content, DoD | | 6 | `Makefile`, `justfile`, `package.json` scripts, `Taskfile.yml` | Official build/test/lint commands | | 7 | `.devcontainer/`, compose/Docker files | Expected dev environment | | 8 | CI workflows | Mandatory PR checks | | 9 | Linter/test configs | Implicit conventions | | 10 | Source tree | Implementation after 1–9 | **Monorepos:** run for root, then repeat for the package you touch. ## Agent instruction map | Kind | Paths | Role | | --- | --- | --- | | Portable contract | `AGENTS.md` | Highest priority for agent behavior | | Cursor | `.cursor/rules/**`, `.cursorrules` | IDE-specific; flag conflicts | | Claude | `CLAUDE.md`, `.claude/**` | Tool-specific memory | | Copilot | `.github/copilot-instructions.md` | GitHub-specific | | Other | `GEMINI.md`, vendor paths | Keep thin if `AGENTS.md` exists | If `AGENTS.md` is missing but tool files exist: follow them and suggest adding portable `AGENTS.md`. ## Conflict resolution | Situation | Resolution | | --- | --- | | README vs `package.json` scripts | Trust `package.json`; note README drift | | AGENTS vs CONTRIBUTING | CONTRIBUTING for human Git flow; AGENTS for agent automation | | AGENTS vs `.cursor/rules` | AGENTS wins; flag contradiction | | Local vs root README | Local for package commands; root for architecture | | Docs vs code | Report mismatch; do not guess | | README vs CI | CI is authoritative for merge gates | ## Routing (summary) Full routing lives in `references/ORCHESTRATION.md` and `skill-catalog.yaml`. One-line examples: - Client delivery → **nanlabs-dev-companion** + **nanlabs-workflow-generic-project** - Work items → **nanlabs-work-item** → epic/story/task/bug/incident skills - Deliverable gate → **nanlabs-output-handshake** before final artifacts - Forge → **github-cli-workflow** / **gitlab-cli-workflow**; PR comments → **gh-address-comments**; CI → **gh-fix-ci** - Tickets → **clickup-cli** or external jira/confluence packs - Workstation health → **nanlabs-workstation-triage** - Internal ClickUp operations → **clickup-cli** State the active workflow and tool skills by name when making non-trivial routing decisions. ## Agents (not skills) Invoke subagents with **@mention** in your message (not the skill tool): `@nanlabs-planner`, `@nanlabs-code-reviewer`, `@nanlabs-security-reviewer`, `@nanlabs-tdd-guide`, `@nanlabs-architect`, `@nanlabs-build-error-resolver`, `@nanlabs-database-reviewer`, `@nanlabs-performance-optimizer`, `@nanlabs-typescript-reviewer`, `@nanlabs-e2e-runner`, `@nanlabs-refactor-cleaner`, `@nanlabs-reference-lookup`, `@nanlabs-client-workflow-bootstrap`, `@nanlabs-docs-lookup`, `@nanlabs-devcompanion-lead`, `@nanlabs-forge-pr`, `@nanlabs-data-validator` Deployed under Claude/Cursor plugins from `nanlabs/agent-toolkit` or Agent Skills install paths. ## Safety - No secrets in repos; use project env patterns and NaNLABS `env.d` where applicable. - Client/account overlays: `~/.nan-ai-workspace/packs/` + `knowledge/` when engagement context applies.