feat: align Nelson with Claude Code dynamic workflows (v1)#126
Merged
Conversation
Add 'workflow' and 'hybrid-workflow' execution modes plus supporting doctrine, battle-plan charter fields, structured-data schema, and tests. Nelson v1 documents and preserves workflow charters but does not generate or invoke .claude/workflows/*.js. - Add workflow + hybrid-workflow to VALID_MODES and CLI help - Add workflow mission-log event types (charter/probe/run started/completed/stopped) - Persist mode + optional workflow charter/advisory fields in battle-plan.json and fleet-status.json - Add references/workflow-doctrine.md; update SKILL.md, README, squadron-composition, tool-mapping, structured-data, and admiralty templates - Add data-validation, schema-preservation, event, hook, and docs tests
…mics Nelson now integrates the /goal feature (session-scoped Stop hooks) and gives the workflow charter a runnable path, so power users can drive both Claude Code features from the framework. Goal alignment (new): - Add references/goal-alignment.md — "standing goal" doctrine. Central fact: the /goal evaluator judges only the conversation transcript, so completion evidence (metric, captain's log path, stand-down) must be surfaced into chat; conditions phrased against on-disk artifacts loop forever. - Add nelson-data.py goal-condition: composes a transcript-verifiable /goal string from sailing-orders.json (outcome + metric + stop criteria + a scuttle-and-reform escape), with --max-turns, --record (persists goal_condition + logs goal_set), and --json. 4,000-char limit enforced. - Wire the standing goal into SKILL.md Step 1 (offer/reconcile), Step 8 (surface evidence so the goal auto-clears), and session resumption (re-establish on a fresh session). - Add goal_set / goal_cleared event types; optional goal_condition field in sailing-orders.json, preserved through later writes. Workflow ergonomics: - workflow-doctrine.md gains a charter-to-runnable-script bridge (charter fields map onto meta/phase/pipeline/parallel + adversarial verify) and a standing-goal-and-workflows section; note saved workflows live in .claude/workflows/*.js and run as /<name>. Docs + tests: - tool-mapping.md: /goal rows, Standing Goal Notes, two anti-patterns. - structured-data.md, README, project_structure updated. - New test_nelson_data_goal.py (19 tests): composer purity/immutability, CLI output/JSON/record/limit, event validity, schema preservation. All sensors green: ruff, ruff format, pytest (415/65/21), pre-commit, markdownlint, typos, check-references. Closes nelson-cni.
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
Implements a v1 alignment layer so Nelson understands Claude Code dynamic workflows without trying to replace them. Nelson gains two first-class execution modes, supporting doctrine, battle-plan charter fields, structured-data schema additions, and tests.
Nelson v1 documents and preserves workflow charters; it does not generate or invoke
.claude/workflows/*.js.Execution modes
workflowhybrid-workflowsingle-session,subagents, andagent-teamare unchanged.ultracodeis documented as a Claude Codexhigheffort/automation setting, not a Nelson mode.Changes
Code
VALID_MODES+=workflow,hybrid-workflow; CLI--modehelp updated acrosssquadron/form/headless.workflow_charter_created,workflow_probe_completed,workflow_run_started,workflow_run_completed,workflow_run_stopped.squadron/formpersist the mode and optional workflow charter / advisory fields intobattle-plan.json;execution_moderecorded infleet-status.json.formmode precedence:plan.mode→squadron.mode→ CLI--mode. Validation for the optionalworkflowobject shape.Docs / doctrine
references/workflow-doctrine.md(suitability, ultracode readiness, "Sounding the Channel" probes, verification contracts, cost controls, telemetry, damage-control mapping).SKILL.md(Steps 3–7),README.md(three → five modes + "Dynamic workflows and ultracode"),squadron-composition.md,tool-mapping.md,structured-data.md, and admiralty templates (battle-plan.md,crew-briefing.md), plusdocs/project_structure.md.Tests
workflow/hybrid-workflow) and invalid-mode rejection.workflowschema acceptance + preservation inbattle-plan.json; existing plan JSON stays valid.headlessmode preservation.Verification
ruff check✓ ·ruff format --check✓pytest skills/nelson/scripts/→ 396 passedpytest hooks/→ 65 passed ·pytest scripts/→ 21 passedpre-commit run --all-files✓ ·scripts/check-references.sh✓