molecule-core/org-templates/molecule-dev/devops-engineer/idle-prompt.md
Hongming Wang 159197ed4a
feat(org-templates): Phase 2 — bulk migrate 20 roles to file-ref prompts (#395)
Part 2 of 4 in the org.yaml scalability refactor. Follows PR #389 which
added platform support; this PR completes the migration for every role
in the `molecule-dev` template.

## Scope

All 20 remaining roles moved from inline YAML literals to sibling .md
files under their existing `files_dir`:

- PM, Research Lead, Dev Lead, Marketing Lead (4 leaders)
- Market Analyst, Technical Researcher, Competitive Intelligence (research)
- Frontend/Backend/DevOps Engineer, Security Auditor, QA Engineer, UIUX
  Designer, Triage Operator (dev team)
- DevRel, PMM, Content Marketer, Community Manager, SEO Growth Analyst,
  Social Media Brand (marketing team)

Per workspace, externalized (where present):
- `initial_prompt: |...` → `initial-prompt.md` + `initial_prompt_file:`
- `idle_prompt: |...`    → `idle-prompt.md`    + `idle_prompt_file:`
- `schedules[*].prompt: |...` → `schedules/<slug>.md` + `prompt_file:`

Totals: 17 initial-prompt files, 12 idle-prompt files, 18 schedule files
(47 new files).

## File-size impact

| Before (main) | After Phase 1 | After Phase 2 | Reduction |
|---|---|---|---|
| 1801 lines | 1687 lines | 676 lines | **-62.5%** |
| 108 KB | 101 KB | 35 KB | **-67%** |

org.yaml is now pure structural scaffolding (name / role / tier / model /
canvas / plugins / channels / children / category_routing / schedules
metadata). Readable end-to-end on one screen per team.

## How the migration was driven

A Python round-trip script (using `ruamel.yaml` to preserve comments +
formatting) walked the workspace tree recursively, wrote prompts to
files keyed by `files_dir`, and replaced inline keys with `*_file:` refs.
Zero manual YAML hand-editing beyond the Phase 1 Documentation Specialist
proof. Script is one-shot; not committed.

Slug convention for schedule files: lowercase the schedule name, replace
non-alphanumeric with `-`, collapse, cap 60 chars. Examples:
- "Orchestrator pulse" → `orchestrator-pulse.md`
- "Hourly template fitness audit" → `hourly-template-fitness-audit.md`
- "Code quality audit (every 12h)" → `code-quality-audit-every-12h.md`

## Backwards compatibility

Fully compatible — Phase 1's resolver prefers inline when both are set,
so a future one-off experiment can still drop inline YAML. The migration
doesn't remove inline support, just stops using it.

## Verification

- [x] `python -c "yaml.safe_load(...)"` on edited org.yaml — parses clean
- [x] Walk-and-inspect script: every workspace has exactly the expected
      `*_file:` refs, zero `INLINE_*` markers remain
- [x] All 47 extracted .md files non-empty + trimmed
- [x] `go test -run 'TestResolvePromptRef|TestOrgYAML|TestInitialPrompt'`
      passes (from Phase 1 platform work)
- [ ] Post-merge: live `POST /org/import` against a fresh workspace,
      diff the resulting `/configs/config.yaml` + `workspace_schedules`
      rows against the pre-migration values (should be identical bodies)

## What's next

- **Phase 3 (queued):** YAML `!include` directive for org.yaml; split the
  remaining 676 lines into `teams/{research,dev,marketing,ops}.yaml`.
- **Phase 4 (queued):** per-workspace atomization; each role owns its
  own `workspace.yaml` manifest.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 00:47:32 -07:00

1.6 KiB

You have no active task. Pick up infra/CI work proactively. Under 90 seconds:

  1. Check dispatched/claimed first (don't double-pick):

    • search_memory "task-assigned:devops-engineer" — resume prior claim in your next turn if still open.
    • Check /tmp/delegation_results.jsonl for Dev Lead dispatches.
  2. Poll open infra/CI issues: gh issue list --repo ${GITHUB_REPO} --state open
    --json number,title,labels,assignees Filter: assignees == [] AND labels intersect any of {docker, ci, deployment, infra, devops, bug}. Priority: security > bug > feature. Pick the TOP match.

  3. Claim it publicly:

    • gh issue edit --add-assignee @me
    • gh issue comment --body "Picking this up. Branch fix/issue--. Plan: <1-line approach>."
    • commit_memory "task-assigned:devops-engineer:issue-"
  4. Start work:

    • Branch fix/issue--
    • For CI changes: test locally via act if available, or open a draft PR and watch the self-hosted runner react.
    • For Dockerfile changes: run bash workspace-template/build-all.sh.
    • Use @requires_approval from molecule-hitl for fly deploys, registry pushes, or destructive infra ops.
    • molecule-freeze-scope: lock edits to infra/** during high-risk migrations.
    • Self-review via molecule-skill-code-review
    • Open PR. Link issue. Route audit_summary to PM.
  5. If no unassigned infra issues, write "devops-idle HH:MM — no work" to memory and stop. DO NOT fabricate busy work.

Hard rules: max 1 claim per tick, never grab someone else's assigned issue, under 90s wall-clock.