Skip to content

feat: Add orchestration context awareness to skills #40

Closed

Description

@admarble

Problem

Individual skills don't know if they're running standalone or as part of /fullsolve. This leads to:

  • Redundant pre-flight checks (each skill checks git state)
  • Duplicate GitHub comment posting
  • Repeated issue fetching
  • Unnecessary work when context is already established

Proposed Solution

Option A: Environment Variable

# /fullsolve sets this before invoking child skills
export SEQUANT_ORCHESTRATOR=fullsolve
export SEQUANT_ISSUE=218

Skills check:

<!-- In skill header -->
If SEQUANT_ORCHESTRATOR is set:
- Skip pre-flight git state checks (parent already did this)
- Skip issue fetch if SEQUANT_ISSUE matches
- Reduce verbosity of progress updates

Option B: Marker File

# /fullsolve creates
echo "fullsolve:218:exec" > /tmp/sequant-context.txt

# Skills check for file and read context

Option C: Skill Parameter

/exec 218 --orchestrated

Implementation

  1. Define context mechanism (recommend Option A - environment variable)
  2. Update /fullsolve to set context before each phase
  3. Update skills to check for orchestration context
  4. Define which steps to skip when orchestrated:
    • Pre-flight git checks → Skip (parent verified)
    • Issue fetch → Use cached if same issue
    • Progress comments → Reduce frequency
    • Final summary → Defer to parent

Acceptance Criteria

  • Define orchestration context mechanism
  • Update /fullsolve to set context
  • Update /exec to check context and skip redundant steps
  • Update /test and /qa similarly
  • Document context behavior in skill headers

Benefits

  • Faster /fullsolve execution (less redundant work)
  • Cleaner GitHub issue comments (not spammed with updates)
  • Better separation of concerns

Priority

Low-Medium - optimization, not blocking

Activity

  1. added
    enhancement
    on Jan 9, 2026
  2. admarble commented on Jan 10, 2026

    @admarble
    ContributorAuthor

    Implementation Plan - Orchestration Context Awareness

    Acceptance Criteria Checklist

    • AC-1: Define orchestration context mechanism

      • Verification: Integration test - env vars available to child skills
      • Test: When /fullsolve 123 runs, SEQUANT_ORCHESTRATOR=fullsolve is set
    • AC-2: Update /fullsolve to set context before each phase

      • Verification: Integration test - context set in executePhase()
      • Test: Each phase receives orchestrator identity in environment
    • AC-3: Update /exec to check context and skip redundant steps

      • Verification: Manual test + code review
      • Test: Standalone /exec = full checks; orchestrated = skip pre-flight
    • AC-4: Update /test and /qa similarly

      • Verification: Manual test + code review
      • Test: Orchestrated invocations skip issue fetch and git state checks
    • AC-5: Document context behavior in skill headers

      • Verification: Manual review
      • Test: Each SKILL.md has "Orchestration Context" section

    Implementation Phases

    Phase 1: TypeScript Changes

    1. Update src/commands/run.ts - extend executePhase() to set:
      • SEQUANT_ORCHESTRATOR=fullsolve
      • SEQUANT_PHASE={current_phase}
      • (Keep existing SEQUANT_ISSUE, SEQUANT_WORKTREE)

    Phase 2: Skill Updates
    2. Update .claude/skills/exec/SKILL.md - conditional pre-flight checks
    3. Update .claude/skills/test/SKILL.md - skip issue fetch when orchestrated
    4. Update .claude/skills/qa/SKILL.md - reduce git sync checks
    5. Update .claude/skills/loop/SKILL.md - same pattern

    Phase 3: Documentation
    6. Add "Orchestration Context" section to each skill header
    7. Update .claude/skills/fullsolve/SKILL.md to document context behavior

    Key Decisions

    Decision Choice Rationale
    Context mechanism Environment variables (Option A) Simpler than files, sufficient for flag-based skipping
    /spec changes None needed Runs first, establishes context
    /loop changes Yes Called during quality iterations

    Assumptions to Validate

    • Environment variables persist correctly between Claude SDK query() calls
    • Markdown skills can reference env vars via conditional instructions
    • No breaking changes to standalone skill invocation

    Estimated Effort

    • TypeScript changes: 1 file, ~20 lines
    • Skill updates: 5 files, ~30-50 lines each (conditionals + docs)
    • Testing: Manual /fullsolve run on test issue

    Recommended Workflow

    Phases: exec → qa
    Quality Loop: disabled


    Plan generated by /spec workflow

  3. added a commit that references this issue on Jan 10, 2026
  4. admarble commented on Jan 10, 2026

    @admarble
    ContributorAuthor

    /exec Progress Update

    AC Coverage

    AC Description Status
    AC-1 Define orchestration context mechanism ✅ MET
    AC-2 Update /fullsolve to set context ✅ MET
    AC-3 Update /exec to check context and skip redundant steps ✅ MET
    AC-4 Update /test and /qa similarly ✅ MET
    AC-5 Document context behavior in skill headers ✅ MET

    Coverage: 5/5 AC items fully met

    Implementation Summary

    Environment Variables Added:

    • SEQUANT_ORCHESTRATOR - Identifies the orchestrator (e.g., sequant-run)
    • SEQUANT_PHASE - Current phase being executed
    • SEQUANT_ISSUE - Issue number (already existed)
    • SEQUANT_WORKTREE - Worktree path (already existed)

    Skills Updated:

    • /exec - Orchestration context section with conditional pre-flight checks and worktree handling
    • /test - Conditional issue fetch and GitHub comments
    • /qa - Conditional pre-flight sync check and worktree location
    • /loop - Conditional worktree lookup and GitHub comments
    • /fullsolve - Documentation of orchestrator role

    Files Changed

    • src/commands/run.ts (+5 lines)
    • .claude/skills/exec/SKILL.md (+43 lines)
    • .claude/skills/test/SKILL.md (+39 lines)
    • .claude/skills/qa/SKILL.md (+42 lines)
    • .claude/skills/loop/SKILL.md (+30 lines)
    • .claude/skills/fullsolve/SKILL.md (+25 lines)

    Quality Checks

    • ✅ npm test: 236 tests passed
    • ✅ npm run build: TypeScript compiles successfully

    PR Status

    Created: #52


    Progress update generated by /exec workflow

  5. added a commit that references this issue on Jan 10, 2026
  6. added a commit that references this issue on Sep 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions