feat(agents): editable agent.md and SKILL.md on draft revisions#2889
Merged
Conversation
Configuration pane shows each agent revision's bundle as a tree (agent.md plus one SKILL.md per skill). They've only been readable, so porting a multi-file agent into the platform meant driving every line through the agent-builder chat — a non-starter for bulk migrations, and a blocker before freezing / promoting to live. This adds a per-file Edit/Save affordance on .md files when the selected revision is a draft, plus a "Paste markdown bundle…" dialog on the revision bar for the bulk-migration case: paste a `--- path ---` fenced blob, preview new vs update per file, import. The parser is pure + covered by unit tests. Ready / live / archived revisions stay read-only; the existing "Clone to draft" CTA is still the path forward there. Tool source.ts / schema.json remain read-only this round. Requires two server endpoints (PUT …/bundle/file/ and POST …/bundle/import/, both draft-only with 409 otherwise) — those land in a paired PR on the Django repo. Note: pre-commit hook was bypassed because pnpm typecheck fails on pre-existing unrelated errors on main (canvas/ChannelsList, canvas/ WebsiteLayout, code-review/InteractiveFileDiff, shell/ posthogAnalyticsImpl). Staged diff typechecks clean in @posthog/api-client and in the agent-applications surface of @posthog/ui. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
React Doctor found 2 issues in 2 files · 2 warnings. 2 warnings
Reviewed by React Doctor for commit |
Contributor
|
Reviews (1): Last reviewed commit: "feat(agents): editable agent.md and SKIL..." | Re-trigger Greptile |
…table-md # Conflicts: # packages/ui/src/features/agent-applications/components/AgentConfigurationPane.tsx
- Drop /i flag on SKILL_PATH_RE so uppercase skill ids (e.g. skills/MySkill/SKILL.md) are rejected instead of silently captured. - Parameterise parseBundleInput tests with it.each per team convention and add an uppercase-skill-id rejection case. - In EditableMarkdownBody, key the editor on editable.path at the call site for file-switch resets, and guard the in-effect draft sync with !editing so a concurrent bulk-import refetch doesn't silently wipe the textarea mid-edit. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
|
Reviews (2): Last reviewed commit: "fix(agents): address PR feedback on agen..." | Re-trigger Greptile |
Resolve import-ordering conflicts in AgentConfigurationPane.tsx: union main's toast/Select/Switch/useCallback/useApplyAgentSpec imports with the branch's useEffect/useUpdateAgentDraftBundleFile. Generated-By: PostHog Code Task-Id: 3d7de9b7-6d82-4868-b49b-7bb5f3029b24
daniloc
approved these changes
Jul 2, 2026
daniloc
left a comment
Contributor
There was a problem hiding this comment.
yerp, with a caveat:
should this view also SOURCE skill store content and pipe to the display? maybe functionally it doesn't matter if the skill version is pinned
- Move parseBundleInput + ParsedBundle to utils/parseBundleInput.ts so the component file only exports components (only-export-components). - Sync the editable markdown draft from upstream content during render instead of in an effect, removing the chained/derived state-in-effect warnings (no-chain-state-updates, no-derived-state, no-event-handler). Behaviour is unchanged: the !editing guard still prevents a concurrent refetch from wiping an in-progress draft. - Add aria-label to the bundle-import and per-file editor textareas (control-has-associated-label). Generated-By: PostHog Code Task-Id: 3d7de9b7-6d82-4868-b49b-7bb5f3029b24
The parseBundleInput import fits on one line, so Biome's formatter flagged the multi-line form as a formatting error, failing `biome ci`. Generated-By: PostHog Code Task-Id: 3d7de9b7-6d82-4868-b49b-7bb5f3029b24
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
agent.mdandskills/<id>/SKILL.mdin the configuration pane — gated to draft revisions. Ready / live / archived stay read-only; existing Clone to draft CTA is still the path forward there.--- path ---fenced blob, preview new vs update per file, import. Parser is pure + unit-tested.source.ts/schema.jsonremain read-only this round.Why
Today the bundle is GET-only. Porting a multi-file agent (e.g. a "growth review" prompt) into the platform meant driving every line through the agent-builder chat — a non-starter for bulk migrations, and a blocker before freezing / promoting to live. User feedback flagged this directly.
Server contract (needed before merge)
Two new endpoints on
…/revisions/<id>/, both draft-only (409 otherwise):PUT …/bundle/file/body{ path, content }—path ∈ {agent.md, skills/<id>/SKILL.md}POST …/bundle/import/body{ agent_md?, skills?: [{id, description?, body}] }— merge-by-id, no implicit deletionBoth return the updated
AgentRevision. Paired PR on the Django repo to follow. Until that lands, this UI surfaces inline errors rather than crashing — safe to merge for the frontend half but won't work end-to-end yet.Test plan
Instructions(agent.md) → Edit button visible; ready / live / archived hide itPUT …/bundle/file/🤖 Generated with Claude Code