feat(skills): deterministic dispatch for every devkit workflow - #71
Merged
Conversation
Every workflow now has a thin trigger skill so natural-language keyword invocation deterministically dispatches to the engine. Prior to this, only 4 of 18 workflows had trigger skills; the rest could only be fired via slash commands or by the agent inferring intent. Added (14 trigger skills): feature, bugfix, refactor, audit, tri-review, tri-debug, tri-security, tri-dispatch, self-audit, self-improve, self-lint, self-migrate, self-perf, self-test. Converted 3 content skills to thin triggers backed by new workflow YAMLs: - test-gen: analyze → generate via test-writer agent → run-fix loop → report - doc-gen: analyze → generate via documenter agent → write - onboard: analyze → architect via researcher agent → write guide Guard fix: added Skill to the command+hard and prompt+hard allowlists in src/cmd/guard.go so a mid-workflow keyword (e.g. "do tri-review" during a feature run) can load its trigger skill instead of being silently blocked. Two new policy-matrix test rows pin the contract. Reference hygiene: skills/creating-workflows frontmatter relabelled REFERENCE ONLY so CC's matcher cannot fire it on natural-language task requests — it is schema docs for writing workflow YAML, not a runnable. Engine sanity test: src/engine/new_workflows_test.go walks workflows/*.yml through ParseFile + Validate so a malformed YAML (existing or new) fails in CI rather than at first devkit_start on the user's box. Verified: - go test ./... — all packages green, new Skill rows pass - bash hooks/hooks_test.sh — 52/52 pass - TestParseAllShippedWorkflows — 21/21 workflow YAMLs parse + validate - go vet + gofmt — clean
- README: workflow count 18→21 (added test-gen, doc-gen, onboard), skill count 22→36, new trigger skill table listing every keyword → workflow mapping. - ROADMAP: skill count 22→36 with full categorization, new bullet for deterministic dispatch closing the entry-gate gap. Runs as part of pr-ready doc-check step before changelog so the doc changes land in this PR alongside the code.
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
Every devkit workflow now has a natural-language trigger skill so keyword-driven invocation is deterministic. Saying "build me a feature", "tri review", "deep research X", "self-lint this", etc., reliably dispatches to the matching workflow via CC's Skill tool →
devkit_start→ engine. Closes the entry-gate gap where 11/18 workflows had no natural-language path at all.feature,bugfix,refactor,audit,tri-review,tri-debug,tri-security,tri-dispatch,self-audit,self-improve,self-lint,self-migrate,self-perf,self-test. Each is ~15 lines — keyword-rich frontmatter + a one-linedevkit_startbody. No duplication of workflow logic.test-gen.yml,doc-gen.yml,onboard.yml— so the existingtest-gen,doc-gen,onboardskills have engine-enforced step machines to dispatch to instead of 60–100-line honor-system step content.test-gen,doc-gen,onboardshrunk to ~14 lines each (thin dispatchers), net −225 lines.src/cmd/guard.gocommand+hardandprompt+hardallowlists now includeSkill, so a nested "do tri-review" inside an activefeatureworkflow actually loads the trigger skill instead of being silently blocked. Two new pinning test rows.src/engine/new_workflows_test.gowalks everyworkflows/*.ymlthroughParseFile+Validateso a malformed workflow fails in CI rather than at firstdevkit_start.skills/creating-workflowsdescription relabelledREFERENCE ONLYso the matcher can't fire it on natural-language task requests. It's schema docs for writing workflow YAML, not a runnable.Why
Before this PR: the devkit engine was 100% deterministic once
devkit_startfired, but only 4 of 18 workflows had natural-language triggers (research, deep-research, pr-ready, autoloop). The other 14 could only be fired via slash command or by the agent inferring intent from context — which is probabilistic and routinely drifted. The engine's determinism guarantee stopped at the entry gate.After this PR: every workflow has a keyword path. The entry gate is ~99% deterministic (skill matching is LLM-decision but descriptions are tight enough that natural phrasing reliably matches). Once
devkit_startfires, the existing guard + stop-guard guarantee remains unchanged — step order, no skipping, no early exit. The net effect is end-to-end determinism: you say the keyword, the workflow runs every step.The honest 1% left: novel phrasings no description anticipates. Recommended fallback is the slash commands (
/devkit:tri-review,/devkit:tri-debug,/devkit:tri-security,/devkit:workflow) which bypass the matcher entirely via CC's exact-string resolver.mega-printentionally stays as a skill (not a workflow) because its "steps" are "fire two external skills in parallel" which doesn't fit the engine's step model.Test plan
go test ./...— all 5 packages green including new Skill policy rowsgo test ./engine/... -run TestParseAllShippedWorkflows— 21/21 workflow YAMLs parse + validatebash hooks/hooks_test.sh— 52/52 passgo vet ./...+gofmt -l— cleanfeatureskill fires anddevkit_start featureis called without the user having to type the slash commandfeatureworkflow, then mid-run say "do tri-review on the diff", confirm thetri-reviewskill loads (previously blocked by the guard)