feat(skill): add dailybot-env sub-skill for .dailybot/env.json per-repo auth - #37
Merged
Merged
Conversation
…po auth
## Summary
Document the new per-repo API key override that ships in dailybot-cli 3.7.0.
`.dailybot/env.json` is an opt-in, gitignored file that carries API keys +
optional URLs for one or more environments (live, local, staging). One
profile is active at a time; when set, it overrides `DAILYBOT_API_KEY`,
`config.json`, and the login Bearer session for the enclosing repo only.
This is the "logged into different orgs in different repos" workflow.
## Change Log
### New files
- `skills/dailybot/env/SKILL.md` — the new `dailybot-env` sub-skill,
matching the layout of the other sub-skills. Pre-flight (CLI version +
gitignore check), quick command reference, four common recipes,
security rules, interaction table, troubleshooting.
- `skills/dailybot/shared/env-json.md` — the shared canonical reference:
full schema, snake_case conventions, precedence table, three-layer
security posture (gitignore + refuse-if-tracked fatal guard + 0o600),
worked examples, troubleshooting, migration notes.
### Updated files
- `skills/dailybot/SKILL.md`:
- Added `dailybot-env` row to the capability routing table.
- Bumped the required-CLI narrative to explain the two-tier floor
(3.1.2 for pre-existing sub-skills, 3.7.0 for env).
- Refreshed the top-level description to mention the new capability.
- `skills/dailybot/shared/repo-profile.md`:
- Rewrote the "What about `.dailybot/` files other than profile.json?"
section to route developers to env-json.md.
- Added an identity-vs-auth-context table clarifying the split.
- Added a rule about not `cat`ing env.json directly (it has API keys).
- `skills/dailybot/shared/auth.md`:
- Added a "Per-repo API key override" section inside the "Auth model"
section, pointing to the new sub-skill.
- `.gitignore`:
- Added an exception `!skills/dailybot/env/` because the existing
Python virtualenv rule (`env/`) was matching the new sub-skill dir.
### Not touched (owned by auto-release)
- `skills/dailybot/SKILL.md::version:` (currently 3.9.0 — the bot bumps).
- Every other sub-skill's `version:` field.
- `CHANGELOG.md` (auto-release prepends).
## Risks
- Zero for backward compat: every existing sub-skill still works at CLI
3.1.2. Only the new env sub-skill requires 3.7.0, and it says so up
front. All 16 SKILL.md files pass `scripts/validate-frontmatter.py`.
## Related
- Companion CLI PR: DailybotHQ/cli#69 (feat(env): add .dailybot/env.json
per-repo API key override). This docs PR should merge AFTER the CLI PR
releases to PyPI, so the 3.7.0 floor is actually reachable via
`dailybot upgrade`.
Co-authored-by: Cursor <cursoragent@cursor.com>
…/403 ## Summary Two shared docs are updated to reflect the CLI's new transparent alt-credential retry, which is what makes .dailybot/env.json usable alongside a stale global Bearer session: - shared/auth.md: expanded the "Automatic fallback" section — retry now fires on 403 (in addition to 401), covers user-scoped endpoints via the new _request() helper (not just agent endpoints), and explicitly enumerates the three real-world cases it fixes. Includes a reference to DRF's 403-for-rejected-credentials behavior. - shared/env-json.md: added an "Interaction with existing auth flows → Transparent Bearer → API-key fallback (auto)" subsection with a step-by-step diagram of the prod-Bearer + local-env.json case, plus the guarantees agents can rely on (single retry, login endpoints never retry, status --auth reports the credential that actually succeeded). ## Change Log - shared/auth.md: rewrote "Automatic fallback on 401" → "Automatic fallback on 401 or 403", added coverage list, DRF citation. - shared/env-json.md: added "Transparent Bearer → API-key fallback (auto)" section under "Interaction with existing auth flows". ## Risks - Docs-only. The behavior change is in the CLI itself (see DailybotHQ/cli PR #69). Co-authored-by: Cursor <cursoragent@cursor.com>
## Summary Elevate the "env.json must never be committed" rule from a footnote into an unmissable STOP block at the top of the shared skill doc, and align the "Security" section with the CLI's actual three-layer enforcement (guard now fires at the root CLI callback for every command, not only for env subcommands). ## Change Log - Prepended a STOP block right after the intro that spells out, in imperative form, the agent's obligations: never `git add`, never `cat` the raw file, never copy it into `tmp/` or a doc example, never bypass the fatal guard, always verify .gitignore before the first `env add`, always treat a past commit as a compromise. - Rewrote § "Security — non-negotiable rules" from 3 to 4 numbered layers (added file permissions as its own layer) and clarified that the fatal refuse-if-tracked guard is triggered at the ROOT of every CLI invocation — every command is blocked, not just env subcommands. Added the recovery recipe with the explicit "rotate first, rewrite history second" ordering. - Added a "Quick full audit an agent can run on demand" recipe: a 5-step bash block covering existence, gitignore coverage, git tracked check, file permissions, and CLI resolution. - Beefed up Example 3 (env off / env on) with a verification sequence proving `disabled: true` truly makes the file inert (falls back to Bearer OTP) and `env on` restores the API-key path — the exact toggle the developer might want to test. ## Risks None (doc-only; no CLI behavior changes here — this doc reflects the corresponding CLI-side security fix that widens the guard). Co-authored-by: Cursor <cursoragent@cursor.com>
…-outs ## Summary The CLI now sends an env.json-sourced API key on the FIRST attempt (the Bearer never reaches the env.json server) and the refuse-if-tracked guard gained precise carve-outs. Update the skill docs to the now-true contract. ## Change Log - env-json.md: fallback section rewritten (env.json key first, retry covers both directions, double-rejection semantics, login redirect warning); precedence table gains the wire-preference note and the explicit --profile carve-out for agent commands; unified "four protections" wording (was contradictory three vs four) - auth.md: documented the single deliberate exception to Bearer-first (env.json-sourced keys, CLI >= 3.7.0) - SKILL.md: removed the self-contradictory "added in v3.10.0" reference (version floor stays durable: CLI >= 3.7.0 for the env sub-skill) - env/SKILL.md: three-layer -> four-layer protection reference ## Risks - Docs-only; frontmatter validation passes for all 16 SKILL.md files. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Document the new per-repo API key override that ships in
dailybot-cli >= 3.7.0..dailybot/env.jsonis an opt-in, gitignored file that carries API keys + optional URL overrides for one or more environments (live, local, staging). One profile is active at a time; when set, it overridesDAILYBOT_API_KEY,config.json, and the login Bearer session for the enclosing repo only.This is the "logged into different orgs in different repos" workflow.
Companion CLI PR: DailybotHQ/cli#69.
Motivating scenarios
Route developers to this sub-skill when they say:
What ships in this PR
New files
skills/dailybot/env/SKILL.md— the newdailybot-envsub-skill. Same layout as the other sub-skills (channels, teams, ...): pre-flight (CLI version + gitignore check), quick command reference, four common recipes, security rules, interaction table, troubleshooting.skills/dailybot/shared/env-json.md— the shared canonical reference. Full schema (snake_case), precedence table (env.json sits at feat(ci): auto-release on merge to main + minimal CI hardening #2, just below CLI flags), three-layer security posture (gitignore + fatal refuse-if-tracked guard +0o600), worked examples, migration notes.Updated files
skills/dailybot/SKILL.md— addeddailybot-envto the capability routing table, rewrote the required-CLI section to explain the two-tier floor (3.1.2 for pre-existing sub-skills, 3.7.0 forenv), refreshed the top-level description.skills/dailybot/shared/repo-profile.md— rewrote the "What about.dailybot/files other thanprofile.json?" section to route developers toenv-json.md; added an identity-vs-auth-context table clarifying the split; added a rule againstcat-ing env.json directly.skills/dailybot/shared/auth.md— added a "Per-repo API key override (.dailybot/env.json)" section inside the "Auth model" section..gitignore— added!skills/dailybot/env/exception because the existing Python virtualenv rule (env/) was matching the new sub-skill directory.Not touched (owned by auto-release)
skills/dailybot/*/SKILL.md::version:— thepython-semantic-releasebot bumps these on merge based on thefeat:commit prefix.CHANGELOG.md— auto-release prepends.Precedence order (as documented)
The full auth-resolution order with env.json inserted at #2:
--profile/--api-url/--app-urlCLI flags.dailybot/env.jsonactive profile.dailybot/profile.json::profile→agents.jsonagents.jsondefault profileDAILYBOT_API_KEYenv varconfig.json::api_keySecurity posture (documented for agents)
Every agent that follows this sub-skill will:
catenv.json. Usesdailybot env show/dailybot env list(both mask API keys)..dailybot/profile.json. That's a hard error at the CLI level.Validation
python3 scripts/validate-frontmatter.py— all 16 SKILL.md files pass.SKILL.md→ env row →env/SKILL.md→shared/env-json.md. Links resolve.Merge timing
This docs PR should merge AFTER the CLI PR (DailybotHQ/cli#69) releases to PyPI, so the
3.7.0floor is actually reachable viadailybot upgrade. Order:dailybot-cli 3.7.0(MINOR bump) to PyPI.If merged in the opposite order, developers who trigger the skill immediately after would see
dailybot: 'env' is not a dailybot commanduntil they upgrade — a soft failure the sub-skill's pre-flight already handles gracefully.Test plan
python3 scripts/validate-frontmatter.py— 16/16 passMade with Cursor