.agents/skills/joycraft-implement-level5/SKILL.md
Set up Level 5 autonomous development — autofix loop, holdout scenario testing, and scenario evolution from specs
npx skillsauth add maksutovic/joycraft joycraft-implement-level5Install this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
You are guiding the user through setting up Level 5: the autonomous feedback loop where specs go in, validated software comes out. This is a one-time setup that installs workflows, creates a scenarios repo, and configures the autofix loop.
Check prerequisites:
.joycraft-version. If missing, tell the user to run npx joycraft init first.docs/joycraft-assessment.md if it exists. If the project hasn't been assessed yet, suggest running $joycraft-tune first. But don't block -- the user may know they're ready..git/ and a GitHub remote.If prerequisites aren't met, explain what's needed and stop.
Tell the user:
Level 5 is the autonomous loop. When you push specs, three things happen automatically:
- Scenario evolution -- An AI agent reads your specs and writes holdout tests in a private scenarios repo. These tests are invisible to your coding agent.
- Autofix -- When CI fails on a PR, the agent automatically attempts a fix (up to 3 times).
- Holdout validation -- When CI passes, your scenarios repo runs behavioral tests against the PR. Results post as PR comments.
The key insight: your coding agent never sees the scenario tests. This prevents it from gaming the test suite -- like a validation set in machine learning.
Ask these questions one at a time:
What should we call your scenarios repo? It'll be a private repo that holds your holdout tests.
Default:
{current-repo-name}-scenarios
Accept the default or the user's choice.
Level 5 needs a GitHub App to provide a separate identity for autofix pushes (this avoids GitHub's anti-recursion protection). Creating one takes about 2 minutes:
- Go to https://github.com/settings/apps/new
- Give it a name (e.g., "My Project Autofix")
- Uncheck "Webhook > Active" (not needed)
- Under Repository permissions, set:
- Contents: Read & Write
- Pull requests: Read & Write
- Actions: Read & Write
- Click Create GitHub App
- Note the App ID from the settings page
- Scroll to Private keys > click Generate a private key > save the
.pemfile- Click Install App in the left sidebar > install it on your repo
What's your App ID?
Run the CLI command with the gathered configuration:
npx joycraft init-autofix --scenarios-repo {name} --app-id {id}
Review the output with the user. Confirm files were created.
Guide the user step by step:
You should already have the
.pemfile from when you created the app in Step 2.
Go to your repo's Settings > Secrets and variables > Actions, and add:
JOYCRAFT_APP_PRIVATE_KEY-- paste the contents of your.pemfileANTHROPIC_API_KEY-- your Anthropic API key (or the appropriate AI provider key for your setup)
Create the private scenarios repo:
gh repo create {scenarios-repo-name} --privateThen copy the scenario templates into it:
cp -r docs/templates/scenarios/* ../{scenarios-repo-name}/ cd ../{scenarios-repo-name} git add -A && git commit -m "init: scaffold scenarios repo from Joycraft" git push
The scenarios repo also needs the App private key:
JOYCRAFT_APP_PRIVATE_KEY-- same.pemfile as the main repoANTHROPIC_API_KEY-- same key (needed for scenario generation)
Help the user verify everything is wired correctly:
ls .github/workflows/autofix.yml .github/workflows/scenarios-dispatch.yml .github/workflows/spec-dispatch.yml .github/workflows/scenarios-rerun.ymlexample-scenario.test.ts, workflows/run.yml, workflows/generate.yml, prompts/scenario-agent.mdIf the project's AGENTS.md doesn't already have an "External Validation" section, add one:
External Validation
This project uses holdout scenario tests in a separate private repo.
NEVER
- Access, read, or reference the scenarios repo
- Mention scenario test names or contents
- Modify the scenarios dispatch workflow to leak test information
The scenarios repo is deliberately invisible to you. This is the holdout guarantee.
If the user wants to test the loop:
Want to do a quick test? Here's how:
- Write a simple spec in
docs/specs/and push to main -- this triggers scenario generation- Create a PR with a small change -- when CI passes, scenarios will run
- Watch for the scenario test results as a PR comment
Or deliberately break something in a PR to test the autofix loop.
Print a summary of what was set up:
Level 5 is live. Here's what's running:
| Trigger | What Happens | |---------|-------------| | Push specs to
docs/specs/| Scenario agent writes holdout tests | | PR fails CI | Autofix agent attempts a fix (up to 3x) | | PR passes CI | Holdout scenarios run against PR | | Scenarios update | Open PRs re-tested with latest scenarios |Your scenarios repo:
{name}Your coding agent cannot see those tests. The holdout wall is intact.
Update docs/joycraft-assessment.md if it exists -- set the Level 5 score to reflect the new setup.
development
Spawn an independent verifier subagent to check an implementation against its spec -- read-only, no code edits, structured pass/fail verdict
development
Assess and upgrade your project's AI development harness — score 7 dimensions, apply fixes, show path to Level 5
testing
Wrap up a session — capture discoveries, verify, prepare for PR or next session
development
Produce objective codebase research by isolating question generation from fact-gathering — subagent sees only questions, never the brief