joycraft 0.5.8 → 0.5.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +39 -3
- package/dist/{chunk-A2CQG5J5.js → chunk-T62ZHD3N.js} +426 -369
- package/dist/chunk-T62ZHD3N.js.map +1 -0
- package/dist/cli.js +3 -3
- package/dist/{init-QXG5BT4Y.js → init-7OQS363N.js} +2 -2
- package/dist/{init-autofix-Y5DQOFEU.js → init-autofix-4JGDJTLP.js} +2 -2
- package/dist/{upgrade-VUOSXPR5.js → upgrade-6Z2GHZAS.js} +2 -2
- package/package.json +1 -1
- package/dist/chunk-A2CQG5J5.js.map +0 -1
- /package/dist/{init-QXG5BT4Y.js.map → init-7OQS363N.js.map} +0 -0
- /package/dist/{init-autofix-Y5DQOFEU.js.map → init-autofix-4JGDJTLP.js.map} +0 -0
- /package/dist/{upgrade-VUOSXPR5.js.map → upgrade-6Z2GHZAS.js.map} +0 -0
|
@@ -5,6 +5,7 @@ var SKILLS = {
|
|
|
5
5
|
"joycraft-decompose.md": `---
|
|
6
6
|
name: joycraft-decompose
|
|
7
7
|
description: Break a feature brief into atomic specs \u2014 small, testable, independently executable units
|
|
8
|
+
instructions: 32
|
|
8
9
|
---
|
|
9
10
|
|
|
10
11
|
# Decompose Feature into Atomic Specs
|
|
@@ -153,6 +154,7 @@ Ready to start execution?
|
|
|
153
154
|
"joycraft-implement-level5.md": `---
|
|
154
155
|
name: joycraft-implement-level5
|
|
155
156
|
description: Set up Level 5 autonomous development \u2014 autofix loop, holdout scenario testing, and scenario evolution from specs
|
|
157
|
+
instructions: 35
|
|
156
158
|
---
|
|
157
159
|
|
|
158
160
|
# Implement Level 5 \u2014 Autonomous Development Loop
|
|
@@ -250,7 +252,7 @@ Guide the user step by step:
|
|
|
250
252
|
|
|
251
253
|
### 4c: Add Secrets to Scenarios Repo
|
|
252
254
|
|
|
253
|
-
> The scenarios repo also needs the
|
|
255
|
+
> The scenarios repo also needs the App private key:
|
|
254
256
|
> - \`JOYCRAFT_APP_PRIVATE_KEY\` \u2014 same \`.pem\` file as the main repo
|
|
255
257
|
> - \`ANTHROPIC_API_KEY\` \u2014 same key (needed for scenario generation)
|
|
256
258
|
|
|
@@ -310,6 +312,7 @@ Update \`docs/joycraft-assessment.md\` if it exists \u2014 set the Level 5 score
|
|
|
310
312
|
"joycraft-interview.md": `---
|
|
311
313
|
name: joycraft-interview
|
|
312
314
|
description: Brainstorm freely about what you want to build \u2014 yap, explore ideas, and get a structured summary you can use later
|
|
315
|
+
instructions: 18
|
|
313
316
|
---
|
|
314
317
|
|
|
315
318
|
# Interview \u2014 Idea Exploration
|
|
@@ -406,6 +409,7 @@ When you're ready to move forward:
|
|
|
406
409
|
"joycraft-new-feature.md": `---
|
|
407
410
|
name: joycraft-new-feature
|
|
408
411
|
description: Guided feature development \u2014 interview the user, produce a Feature Brief, then decompose into atomic specs
|
|
412
|
+
instructions: 35
|
|
409
413
|
---
|
|
410
414
|
|
|
411
415
|
# New Feature Workflow
|
|
@@ -416,24 +420,21 @@ You are starting a new feature. Follow this process in order. Do not skip steps.
|
|
|
416
420
|
|
|
417
421
|
Interview the user about what they want to build. Let them talk \u2014 your job is to listen, then sharpen.
|
|
418
422
|
|
|
419
|
-
**Why:** A thorough interview prevents wasted implementation time. Most failed features fail because the problem wasn't understood, not because the code was wrong.
|
|
420
|
-
|
|
421
423
|
**Ask about:**
|
|
422
424
|
- What problem does this solve? Who is affected?
|
|
423
|
-
- What does "done" look like?
|
|
424
|
-
-
|
|
425
|
-
- What is explicitly NOT in scope? (push hard on this
|
|
426
|
-
-
|
|
425
|
+
- What does "done" look like?
|
|
426
|
+
- Hard constraints? (business rules, tech limitations, deadlines)
|
|
427
|
+
- What is explicitly NOT in scope? (push hard on this)
|
|
428
|
+
- Edge cases or error conditions?
|
|
427
429
|
- What existing code/patterns should this follow?
|
|
430
|
+
- Testing: existing setup? framework? smoke test budget? lockdown mode desired?
|
|
428
431
|
|
|
429
432
|
**Interview technique:**
|
|
430
|
-
- Let the user "yap" \u2014 don't interrupt their flow
|
|
431
|
-
-
|
|
432
|
-
- Ask clarifying questions that force specificity: "When you say 'handle errors,' what should the user see?"
|
|
433
|
+
- Let the user "yap" \u2014 don't interrupt their flow
|
|
434
|
+
- Play back your understanding: "So if I'm hearing you right..."
|
|
433
435
|
- Push toward testable statements: "How would we verify that works?"
|
|
434
436
|
|
|
435
|
-
Keep asking until you can fill out a Feature Brief.
|
|
436
|
-
"I have enough context. Let me write the Feature Brief for your review."
|
|
437
|
+
Keep asking until you can fill out a Feature Brief.
|
|
437
438
|
|
|
438
439
|
## Phase 2: Feature Brief
|
|
439
440
|
|
|
@@ -465,6 +466,13 @@ What are we building and why? The full picture in 2-4 paragraphs.
|
|
|
465
466
|
## Out of Scope
|
|
466
467
|
- NOT: [tempting but deferred]
|
|
467
468
|
|
|
469
|
+
## Test Strategy
|
|
470
|
+
- **Existing setup:** [framework and tools, or "none yet"]
|
|
471
|
+
- **User expertise:** [comfortable / learning / needs guidance]
|
|
472
|
+
- **Test types:** [smoke, unit, integration, e2e, etc.]
|
|
473
|
+
- **Smoke test budget:** [target time for fast-feedback tests]
|
|
474
|
+
- **Lockdown mode:** [yes/no \u2014 constrain agent to code + tests only]
|
|
475
|
+
|
|
468
476
|
## Decomposition
|
|
469
477
|
| # | Spec Name | Description | Dependencies | Est. Size |
|
|
470
478
|
|---|-----------|-------------|--------------|-----------|
|
|
@@ -585,6 +593,7 @@ You can also use \`/joycraft-decompose\` to re-decompose a brief if the breakdow
|
|
|
585
593
|
"joycraft-session-end.md": `---
|
|
586
594
|
name: joycraft-session-end
|
|
587
595
|
description: Wrap up a session \u2014 capture discoveries, verify, prepare for PR or next session
|
|
596
|
+
instructions: 22
|
|
588
597
|
---
|
|
589
598
|
|
|
590
599
|
# Session Wrap-Up
|
|
@@ -683,387 +692,77 @@ Session complete.
|
|
|
683
692
|
"joycraft-tune.md": `---
|
|
684
693
|
name: joycraft-tune
|
|
685
694
|
description: Assess and upgrade your project's AI development harness \u2014 score 7 dimensions, apply fixes, show path to Level 5
|
|
695
|
+
instructions: 15
|
|
686
696
|
---
|
|
687
697
|
|
|
688
698
|
# Tune \u2014 Project Harness Assessment & Upgrade
|
|
689
699
|
|
|
690
|
-
You are evaluating and upgrading this project's AI development harness.
|
|
700
|
+
You are evaluating and upgrading this project's AI development harness.
|
|
691
701
|
|
|
692
702
|
## Step 1: Detect Harness State
|
|
693
703
|
|
|
694
|
-
Check
|
|
695
|
-
|
|
696
|
-
1. **CLAUDE.md** \u2014 Read it if it exists. Check whether it contains meaningful content (not just a project name or generic README).
|
|
697
|
-
2. **Key directories** \u2014 Check for: \`docs/specs/\`, \`docs/briefs/\`, \`docs/discoveries/\`, \`docs/templates/\`, \`.claude/skills/\`
|
|
698
|
-
3. **Boundary framework** \u2014 Look for \`Always\`, \`Ask First\`, and \`Never\` sections in CLAUDE.md (or similar behavioral constraints under any heading).
|
|
699
|
-
4. **Skills infrastructure** \u2014 Check \`.claude/skills/\` for installed skill files.
|
|
700
|
-
5. **Test configuration** \u2014 Look for test commands in package.json, pyproject.toml, Cargo.toml, Makefile, or CI config files.
|
|
701
|
-
|
|
702
|
-
## Step 2: Route Based on State
|
|
703
|
-
|
|
704
|
-
### If No Harness (no CLAUDE.md, or CLAUDE.md is just a README with no structured sections):
|
|
705
|
-
|
|
706
|
-
Tell the user:
|
|
707
|
-
- Their project has no AI development harness
|
|
708
|
-
- Recommend running \`npx joycraft init\` to scaffold one
|
|
709
|
-
- Briefly explain what it sets up: CLAUDE.md with boundaries, spec/brief templates, skills, documentation structure
|
|
710
|
-
- **Stop here** \u2014 do not run the full assessment on a bare project
|
|
711
|
-
|
|
712
|
-
### If Harness Exists (CLAUDE.md has structured content \u2014 boundaries, commands, architecture, or domain rules):
|
|
713
|
-
|
|
714
|
-
Continue to Step 3 for the full assessment.
|
|
715
|
-
|
|
716
|
-
## Step 3: Score 7 Dimensions
|
|
717
|
-
|
|
718
|
-
Read CLAUDE.md thoroughly. Explore the project structure. Score each dimension on a 1-5 scale with specific evidence.
|
|
719
|
-
|
|
720
|
-
### Dimension 1: Spec Quality
|
|
721
|
-
|
|
722
|
-
Look in \`docs/specs/\` for specification files.
|
|
723
|
-
|
|
724
|
-
| Score | Criteria |
|
|
725
|
-
|-------|----------|
|
|
726
|
-
| 1 | No specs directory or no spec files |
|
|
727
|
-
| 2 | Specs exist but are informal notes or TODOs |
|
|
728
|
-
| 3 | Specs have structure (sections, some criteria) but lack consistency |
|
|
729
|
-
| 4 | Specs are structured with clear acceptance criteria and constraints |
|
|
730
|
-
| 5 | Atomic specs: self-contained, acceptance criteria, constraints, edge cases, affected files |
|
|
731
|
-
|
|
732
|
-
**Evidence:** Number of specs found, example of best/worst, whether acceptance criteria are present.
|
|
733
|
-
|
|
734
|
-
### Dimension 2: Spec Granularity
|
|
735
|
-
|
|
736
|
-
Can each spec be completed in a single coding session?
|
|
704
|
+
Check for: CLAUDE.md (with meaningful content), \`docs/specs/\`, \`docs/briefs/\`, \`docs/discoveries/\`, \`.claude/skills/\`, and test configuration.
|
|
737
705
|
|
|
738
|
-
|
|
739
|
-
|-------|----------|
|
|
740
|
-
| 1 | No specs |
|
|
741
|
-
| 2 | Specs cover entire features or epics |
|
|
742
|
-
| 3 | Specs are feature-sized (multi-session but bounded) |
|
|
743
|
-
| 4 | Most specs are session-sized with clear scope |
|
|
744
|
-
| 5 | All specs are atomic \u2014 one session, one concern, clear done state |
|
|
706
|
+
## Step 2: Route
|
|
745
707
|
|
|
746
|
-
|
|
708
|
+
- **No harness** (no CLAUDE.md or just a README): Recommend \`npx joycraft init\` and stop.
|
|
709
|
+
- **Harness exists**: Continue to assessment.
|
|
747
710
|
|
|
748
|
-
|
|
711
|
+
## Step 3: Assess \u2014 Score 7 Dimensions (1-5 scale)
|
|
749
712
|
|
|
750
|
-
|
|
751
|
-
|-------|----------|
|
|
752
|
-
| 1 | No CLAUDE.md or no behavioral guidance |
|
|
753
|
-
| 2 | CLAUDE.md exists with general instructions but no structured boundaries |
|
|
754
|
-
| 3 | Some boundaries exist but not organized as Always/Ask First/Never |
|
|
755
|
-
| 4 | Always/Ask First/Never sections present with reasonable coverage |
|
|
756
|
-
| 5 | Comprehensive boundaries covering code style, testing, deployment, dependencies, and dangerous operations |
|
|
713
|
+
Read CLAUDE.md and explore the project. Score each with specific evidence:
|
|
757
714
|
|
|
758
|
-
|
|
715
|
+
| Dimension | What to Check |
|
|
716
|
+
|-----------|--------------|
|
|
717
|
+
| Spec Quality | \`docs/specs/\` \u2014 structured? acceptance criteria? self-contained? |
|
|
718
|
+
| Spec Granularity | Can each spec be done in one session? |
|
|
719
|
+
| Behavioral Boundaries | ALWAYS/ASK FIRST/NEVER sections (or equivalent rules under any heading) |
|
|
720
|
+
| Skills & Hooks | \`.claude/skills/\` files, hooks config |
|
|
721
|
+
| Documentation | \`docs/\` structure, templates, referenced from CLAUDE.md |
|
|
722
|
+
| Knowledge Capture | \`docs/discoveries/\`, \`docs/context/*.md\` \u2014 existence AND real content |
|
|
723
|
+
| Testing & Validation | Test framework, CI pipeline, validation commands in CLAUDE.md |
|
|
759
724
|
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
Look in \`.claude/skills/\` for skill files. Check for hooks configuration.
|
|
763
|
-
|
|
764
|
-
| Score | Criteria |
|
|
765
|
-
|-------|----------|
|
|
766
|
-
| 1 | No .claude/ directory |
|
|
767
|
-
| 2 | .claude/ exists but empty or minimal |
|
|
768
|
-
| 3 | A few skills installed, no hooks |
|
|
769
|
-
| 4 | Multiple relevant skills, basic hooks |
|
|
770
|
-
| 5 | Comprehensive skills covering workflow, hooks for validation |
|
|
771
|
-
|
|
772
|
-
### Dimension 5: Documentation
|
|
773
|
-
|
|
774
|
-
Examine \`docs/\` directory structure and content.
|
|
775
|
-
|
|
776
|
-
| Score | Criteria |
|
|
777
|
-
|-------|----------|
|
|
778
|
-
| 1 | No docs/ directory |
|
|
779
|
-
| 2 | docs/ exists with ad-hoc files |
|
|
780
|
-
| 3 | Some structure (subdirectories) but inconsistent |
|
|
781
|
-
| 4 | Structured docs/ with templates and clear organization |
|
|
782
|
-
| 5 | Full structure: briefs/, specs/, templates/, architecture docs, referenced from CLAUDE.md |
|
|
783
|
-
|
|
784
|
-
### Dimension 6: Knowledge Capture & Contextual Stewardship
|
|
785
|
-
|
|
786
|
-
Look for discoveries, decisions, session notes, and context documents.
|
|
787
|
-
|
|
788
|
-
| Score | Criteria |
|
|
789
|
-
|-------|----------|
|
|
790
|
-
| 1 | No knowledge capture mechanism |
|
|
791
|
-
| 2 | Ad-hoc notes or a discoveries directory with no entries |
|
|
792
|
-
| 3 | Discoveries directory with some entries, or context docs exist but empty |
|
|
793
|
-
| 4 | Active discoveries + at least 2 context docs with content (production-map, dangerous-assumptions, decision-log, institutional-knowledge) |
|
|
794
|
-
| 5 | Full contextual stewardship: discoveries with entries, all 4 context docs maintained, session-end workflow in active use |
|
|
795
|
-
|
|
796
|
-
**Check for:** \`docs/discoveries/\`, \`docs/context/production-map.md\`, \`docs/context/dangerous-assumptions.md\`, \`docs/context/decision-log.md\`, \`docs/context/institutional-knowledge.md\`. Score based on both existence AND whether they have real content (not just templates).
|
|
797
|
-
|
|
798
|
-
### Dimension 7: Testing & Validation
|
|
799
|
-
|
|
800
|
-
Look for test config, CI setup, and validation commands.
|
|
801
|
-
|
|
802
|
-
| Score | Criteria |
|
|
803
|
-
|-------|----------|
|
|
804
|
-
| 1 | No test configuration |
|
|
805
|
-
| 2 | Test framework installed but few/no tests |
|
|
806
|
-
| 3 | Tests exist with reasonable coverage |
|
|
807
|
-
| 4 | Tests + CI pipeline configured |
|
|
808
|
-
| 5 | Tests + CI + validation commands in CLAUDE.md + scenario tests |
|
|
725
|
+
Score 1 = absent, 3 = partially there, 5 = comprehensive. Give credit for substance over format.
|
|
809
726
|
|
|
810
727
|
## Step 4: Write Assessment
|
|
811
728
|
|
|
812
|
-
Write
|
|
813
|
-
|
|
814
|
-
\`\`\`markdown
|
|
815
|
-
# Joycraft Assessment \u2014 [Project Name]
|
|
816
|
-
|
|
817
|
-
**Date:** [today's date]
|
|
818
|
-
**Overall Level:** [1-5, based on average score]
|
|
819
|
-
|
|
820
|
-
## Scores
|
|
821
|
-
|
|
822
|
-
| Dimension | Score | Summary |
|
|
823
|
-
|-----------|-------|---------|
|
|
824
|
-
| Spec Quality | X/5 | [one-line summary] |
|
|
825
|
-
| Spec Granularity | X/5 | [one-line summary] |
|
|
826
|
-
| Behavioral Boundaries | X/5 | [one-line summary] |
|
|
827
|
-
| Skills & Hooks | X/5 | [one-line summary] |
|
|
828
|
-
| Documentation | X/5 | [one-line summary] |
|
|
829
|
-
| Knowledge Capture | X/5 | [one-line summary] |
|
|
830
|
-
| Testing & Validation | X/5 | [one-line summary] |
|
|
831
|
-
|
|
832
|
-
**Average:** X.X/5
|
|
833
|
-
|
|
834
|
-
## Detailed Findings
|
|
835
|
-
|
|
836
|
-
### [Dimension Name] \u2014 X/5
|
|
837
|
-
**Evidence:** [specific files, paths, counts found]
|
|
838
|
-
**Gap:** [what's missing]
|
|
839
|
-
**Recommendation:** [specific action to improve]
|
|
840
|
-
|
|
841
|
-
## Upgrade Plan
|
|
842
|
-
|
|
843
|
-
To reach Level [current + 1], complete these steps:
|
|
844
|
-
1. [Most impactful action] \u2014 addresses [dimension] (X -> Y)
|
|
845
|
-
2. [Next action] \u2014 addresses [dimension] (X -> Y)
|
|
846
|
-
[up to 5 actions, ordered by impact]
|
|
847
|
-
\`\`\`
|
|
729
|
+
Write to \`docs/joycraft-assessment.md\` AND display it. Include: scores table, detailed findings (evidence + gap + recommendation per dimension), and an upgrade plan (up to 5 actions ordered by impact).
|
|
848
730
|
|
|
849
731
|
## Step 5: Apply Upgrades
|
|
850
732
|
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
### Tier 1: Silent Apply (just do it)
|
|
854
|
-
These are safe, additive operations. Apply them without asking:
|
|
855
|
-
- Create missing directories (\`docs/specs/\`, \`docs/briefs/\`, \`docs/discoveries/\`, \`docs/templates/\`)
|
|
856
|
-
- Install missing skills to \`.claude/skills/\`
|
|
857
|
-
- Copy missing templates to \`docs/templates/\`
|
|
858
|
-
- Create AGENTS.md if it doesn't exist
|
|
859
|
-
|
|
860
|
-
### Git Autonomy Preference
|
|
861
|
-
|
|
862
|
-
Before applying Behavioral Boundaries to CLAUDE.md, ask the user ONE question:
|
|
863
|
-
|
|
864
|
-
> How autonomous should git operations be?
|
|
865
|
-
> 1. **Cautious** \u2014 commits freely, asks before pushing or opening PRs *(good for learning the workflow)*
|
|
866
|
-
> 2. **Autonomous** \u2014 commits, pushes to branches, and opens PRs without asking *(good for spec-driven development)*
|
|
867
|
-
|
|
868
|
-
Based on their answer, use the appropriate git rules in the Behavioral Boundaries section:
|
|
869
|
-
|
|
870
|
-
**If Cautious (default):**
|
|
871
|
-
\`\`\`
|
|
872
|
-
### ASK FIRST
|
|
873
|
-
- Pushing to remote
|
|
874
|
-
- Creating or merging pull requests
|
|
875
|
-
- Any destructive git operation (force-push, reset --hard, branch deletion)
|
|
876
|
-
|
|
877
|
-
### NEVER
|
|
878
|
-
- Push directly to main/master without approval
|
|
879
|
-
- Amend commits that have been pushed
|
|
880
|
-
\`\`\`
|
|
881
|
-
|
|
882
|
-
**If Autonomous:**
|
|
883
|
-
\`\`\`
|
|
884
|
-
### ALWAYS \u2014 Git Autonomy (STRICTLY ENFORCED)
|
|
885
|
-
|
|
886
|
-
> **This project uses fully autonomous git operations.** The user has explicitly
|
|
887
|
-
> granted permission for all git operations below. Do NOT ask for confirmation.
|
|
888
|
-
> Do NOT hesitate. Do NOT treat these as suggestions. These are standing orders
|
|
889
|
-
> that override any default caution about pushing or creating PRs.
|
|
890
|
-
|
|
891
|
-
- **Commit early and often** \u2014 after each logical unit of work, not just at session end
|
|
892
|
-
- **Push to feature branches immediately after every commit** \u2014 do not batch pushes, do not wait, do not ask
|
|
893
|
-
- **Open a PR when all specs in a feature are complete** \u2014 use gh pr create, do not ask first
|
|
894
|
-
- **Use descriptive branch names:** feature/spec-name or fix/description
|
|
895
|
-
- **After /joycraft-session-end:** push all commits and open a PR if the feature is complete
|
|
896
|
-
|
|
897
|
-
### ASK FIRST
|
|
898
|
-
- Merging PRs to main/master
|
|
899
|
-
- Any destructive git operation (force-push, reset --hard, branch deletion)
|
|
900
|
-
|
|
901
|
-
### NEVER
|
|
902
|
-
- Push directly to main/master (always use feature branches + PR)
|
|
903
|
-
- Amend commits that have been pushed to remote
|
|
904
|
-
- Ask "should I push?" or "should I create a PR?" \u2014 the answer is always yes, just do it
|
|
905
|
-
\`\`\`
|
|
906
|
-
|
|
907
|
-
### Permission Mode Recommendation
|
|
908
|
-
|
|
909
|
-
After the git autonomy question and before the risk interview, recommend a Claude Code permission mode based on what you've learned so far. Present this guidance:
|
|
910
|
-
|
|
911
|
-
> **What permission mode should you use?**
|
|
912
|
-
>
|
|
913
|
-
> | Your situation | Use | Why |
|
|
914
|
-
> |---|---|---|
|
|
915
|
-
> | Autonomous spec execution | \`--permission-mode dontAsk\` + allowlist | Only pre-approved commands run |
|
|
916
|
-
> | Long session with some trust | \`--permission-mode auto\` | Safety classifier reviews each action |
|
|
917
|
-
> | Interactive development | \`--permission-mode acceptEdits\` | Auto-approves file edits, prompts for commands |
|
|
918
|
-
>
|
|
919
|
-
> You do NOT need \`--dangerously-skip-permissions\`. The modes above provide autonomy with safety.
|
|
920
|
-
|
|
921
|
-
**If the user chose Autonomous git:** Recommend \`auto\` mode as a good default -- it provides autonomy while the safety classifier catches risky operations. Note that \`dontAsk\` is even more autonomous but requires a well-configured allowlist.
|
|
922
|
-
|
|
923
|
-
**If the user chose Cautious git:** Recommend \`auto\` mode -- it matches their preference for safety with less manual intervention than the default.
|
|
924
|
-
|
|
925
|
-
**If the risk interview reveals production databases, live APIs, or billing systems:** Upgrade the recommendation to \`dontAsk\` with a tight allowlist. Explain that \`dontAsk\` with explicit deny patterns is safer than \`auto\` for high-risk environments because it uses a deterministic allowlist rather than a classifier.
|
|
926
|
-
|
|
927
|
-
This is informational only -- do not change the user's permission mode. Just tell them what to use when they launch Claude Code.
|
|
928
|
-
|
|
929
|
-
### Risk Interview
|
|
930
|
-
|
|
931
|
-
Before applying upgrades, ask 3-5 targeted questions to capture what's dangerous in this project. Skip this if \`docs/context/production-map.md\` or \`docs/context/dangerous-assumptions.md\` already exist (offer to update instead).
|
|
932
|
-
|
|
933
|
-
**Question 1:** "What could this agent break that would ruin your day? Think: production databases, live APIs, billing systems, user data, infrastructure."
|
|
934
|
-
|
|
935
|
-
From the answer, generate:
|
|
936
|
-
- NEVER rules for CLAUDE.md (e.g., "NEVER connect to production DB at postgres://prod.example.com")
|
|
937
|
-
- Deny patterns for .claude/settings.json (e.g., deny Bash commands containing production hostnames)
|
|
938
|
-
|
|
939
|
-
**Question 2:** "What external services does this project connect to? Which are production vs. staging/dev?"
|
|
733
|
+
Apply using three tiers \u2014 do NOT ask per-item permission:
|
|
940
734
|
|
|
941
|
-
|
|
942
|
-
- \`docs/context/production-map.md\` documenting what's real vs safe to touch
|
|
943
|
-
- Include: service name, URL/endpoint, environment (prod/staging/dev), what happens if corrupted
|
|
735
|
+
**Tier 1 (silent):** Create missing dirs, install missing skills, copy missing templates, create AGENTS.md.
|
|
944
736
|
|
|
945
|
-
**
|
|
737
|
+
**Before Tier 2, ask TWO things:**
|
|
946
738
|
|
|
947
|
-
|
|
948
|
-
-
|
|
949
|
-
- \`docs/context/dangerous-assumptions.md\` with "Agent might assume X, but actually Y"
|
|
739
|
+
1. **Git autonomy:** Cautious (ask before push/PR) or Autonomous (push + PR without asking)?
|
|
740
|
+
2. **Risk interview (3-5 questions, one at a time):** What could break? What services connect to prod? Unwritten rules? Off-limits files/commands? Skip if \`docs/context/\` already has content.
|
|
950
741
|
|
|
951
|
-
|
|
742
|
+
From answers, generate: CLAUDE.md boundary rules, \`.claude/settings.json\` deny patterns, \`docs/context/\` documents. Also recommend a permission mode (\`auto\` for most; \`dontAsk\` + allowlist for high-risk).
|
|
952
743
|
|
|
953
|
-
|
|
744
|
+
**Tier 2 (show diff):** Add missing CLAUDE.md sections (Boundaries, Workflow, Key Files). Draft from real codebase content. Append only \u2014 never reformat existing content.
|
|
954
745
|
|
|
955
|
-
**
|
|
746
|
+
**Tier 3 (confirm first):** Rewriting existing sections, overwriting customized files, suggesting test framework installs.
|
|
956
747
|
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
**Rules for the interview:**
|
|
960
|
-
- Ask questions ONE AT A TIME, not all at once
|
|
961
|
-
- If the user says "nothing" or "skip", respect that and move on
|
|
962
|
-
- Keep it to 2-3 minutes total \u2014 don't interrogate
|
|
963
|
-
- Generate artifacts immediately after the interview, don't wait for all questions
|
|
964
|
-
- This is the SECOND and LAST set of questions during /joycraft-tune (first is git autonomy)
|
|
965
|
-
|
|
966
|
-
### Tier 2: Apply and Show Diff (do it, then report)
|
|
967
|
-
These modify important files but are additive (append-only). Apply them, then show what changed so the user can review. Git is the undo button.
|
|
968
|
-
- Add missing sections to CLAUDE.md (Behavioral Boundaries, Development Workflow, Getting Started with Joycraft, Key Files, Common Gotchas)
|
|
969
|
-
- Use the git autonomy preference from above when generating the Behavioral Boundaries section
|
|
970
|
-
- Draft section content from the actual codebase \u2014 not generic placeholders. Read the project's real rules, real commands, real structure.
|
|
971
|
-
- Only append \u2014 never modify or reformat existing content
|
|
972
|
-
|
|
973
|
-
### Tier 3: Confirm First (ask before acting)
|
|
974
|
-
These are potentially destructive or opinionated. Ask before proceeding:
|
|
975
|
-
- Rewriting or reorganizing existing CLAUDE.md sections
|
|
976
|
-
- Overwriting files the user has customized
|
|
977
|
-
- Suggesting test framework installation or CI setup (present as recommendations, don't auto-install)
|
|
978
|
-
|
|
979
|
-
### Reading a Previous Assessment
|
|
980
|
-
|
|
981
|
-
If \`docs/joycraft-assessment.md\` already exists, read it first. If all recommendations have been applied, report "nothing to upgrade" and offer to re-assess.
|
|
982
|
-
|
|
983
|
-
### After Applying
|
|
984
|
-
|
|
985
|
-
Append a history entry to \`docs/joycraft-history.md\` (create if needed):
|
|
986
|
-
\`\`\`
|
|
987
|
-
| [date] | [new avg score] | [change from last] | [summary of what changed] |
|
|
988
|
-
\`\`\`
|
|
989
|
-
|
|
990
|
-
Then display a single consolidated report:
|
|
991
|
-
|
|
992
|
-
\`\`\`markdown
|
|
993
|
-
## Upgrade Results
|
|
994
|
-
|
|
995
|
-
| Dimension | Before | After | Change |
|
|
996
|
-
|------------------------|--------|-------|--------|
|
|
997
|
-
| Spec Quality | X/5 | X/5 | +X |
|
|
998
|
-
| ... | ... | ... | ... |
|
|
999
|
-
|
|
1000
|
-
**Previous Level:** X \u2014 **New Level:** X
|
|
1001
|
-
|
|
1002
|
-
### What Changed
|
|
1003
|
-
- [list each change applied]
|
|
1004
|
-
|
|
1005
|
-
### Remaining Gaps
|
|
1006
|
-
- [anything still below 3.5, with specific next action]
|
|
1007
|
-
\`\`\`
|
|
1008
|
-
|
|
1009
|
-
Update \`docs/joycraft-assessment.md\` with the new scores and today's date.
|
|
748
|
+
After applying, append to \`docs/joycraft-history.md\` and show a consolidated upgrade results table.
|
|
1010
749
|
|
|
1011
750
|
## Step 6: Show Path to Level 5
|
|
1012
751
|
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
\`\`\`markdown
|
|
1016
|
-
## Path to Level 5 \u2014 Autonomous Development
|
|
1017
|
-
|
|
1018
|
-
You're at Level [X]. Here's what each level looks like:
|
|
1019
|
-
|
|
1020
|
-
| Level | You | AI | Key Skill |
|
|
1021
|
-
|-------|-----|-----|-----------|
|
|
1022
|
-
| 2 | Guide direction | Multi-file changes | AI-native tooling |
|
|
1023
|
-
| 3 | Review diffs | Primary developer | Code review at scale |
|
|
1024
|
-
| 4 | Write specs, check tests | End-to-end development | Specification writing |
|
|
1025
|
-
| 5 | Define what + why | Specs in, software out | Systems design |
|
|
1026
|
-
|
|
1027
|
-
### Your Next Steps Toward Level [X+1]:
|
|
1028
|
-
1. [Specific action based on current gaps \u2014 e.g., "Write your first atomic spec using /joycraft-new-feature"]
|
|
1029
|
-
2. [Next action \u2014 e.g., "Add vitest and write tests for your core logic"]
|
|
1030
|
-
3. [Next action \u2014 e.g., "Use /joycraft-session-end consistently to build your discoveries log"]
|
|
1031
|
-
|
|
1032
|
-
### What Level 5 Looks Like (Your North Star):
|
|
1033
|
-
- A backlog of ready specs that agents pull from and execute autonomously
|
|
1034
|
-
- CI failures auto-generate fix specs \u2014 no human triage for regressions
|
|
1035
|
-
- Multi-agent execution with parallel worktrees, one spec per agent
|
|
1036
|
-
- External holdout scenarios (tests the agent can't see) prevent overfitting
|
|
1037
|
-
- CLAUDE.md evolves from discoveries \u2014 the harness improves itself
|
|
1038
|
-
|
|
1039
|
-
### You'll Know You're at Level 5 When:
|
|
1040
|
-
- You describe a feature in one sentence and walk away
|
|
1041
|
-
- The system produces a PR with tests, docs, and discoveries \u2014 without further input
|
|
1042
|
-
- Failed CI runs generate their own fix specs
|
|
1043
|
-
- Your harness improves without you manually editing CLAUDE.md
|
|
1044
|
-
|
|
1045
|
-
This is a significant journey. Most teams are at Level 2. Getting to Level 4 with Joycraft's workflow is achievable \u2014 Level 5 requires building validation infrastructure (scenario tests, spec queues, CI feedback loops) that goes beyond what Joycraft scaffolds today. But the harness you're building now is the foundation.
|
|
1046
|
-
\`\`\`
|
|
1047
|
-
|
|
1048
|
-
Tailor the "Next Steps" section based on the project's actual gaps \u2014 don't show generic advice.
|
|
752
|
+
Show a tailored roadmap: Level 2-5 table, specific next steps based on actual gaps, and the Level 5 north star (spec queue, autofix, holdout scenarios, self-improving harness).
|
|
1049
753
|
|
|
1050
754
|
## Edge Cases
|
|
1051
755
|
|
|
1052
|
-
- **
|
|
1053
|
-
- **
|
|
1054
|
-
- **
|
|
1055
|
-
- **
|
|
1056
|
-
- **
|
|
1057
|
-
- **Assessment file missing when upgrading:** Run the full assessment first, then offer to apply.
|
|
1058
|
-
- **Assessment is stale:** Warn and offer to re-assess before proceeding.
|
|
1059
|
-
- **All recommendations already applied:** Report "nothing to upgrade" and stop.
|
|
1060
|
-
- **User declines a recommendation:** Skip it, continue, include in "What Was Skipped."
|
|
1061
|
-
- **CLAUDE.md does not exist at all:** Create it with recommended sections, but ask the user first.
|
|
1062
|
-
- **Non-Joycraft content in CLAUDE.md:** Preserve exactly as-is. Only append or merge \u2014 never remove or reformat existing content.
|
|
756
|
+
- **CLAUDE.md is just a README:** Treat as no harness.
|
|
757
|
+
- **Non-Joycraft skills:** Acknowledge, don't replace.
|
|
758
|
+
- **Rules under non-standard headings:** Give credit for substance.
|
|
759
|
+
- **Previous assessment exists:** Read it first. If nothing to upgrade, say so.
|
|
760
|
+
- **Non-Joycraft content in CLAUDE.md:** Preserve as-is. Only append.
|
|
1063
761
|
`,
|
|
1064
762
|
"joycraft-add-fact.md": `---
|
|
1065
763
|
name: joycraft-add-fact
|
|
1066
764
|
description: Capture a project fact and route it to the correct context document -- production map, dangerous assumptions, decision log, institutional knowledge, or troubleshooting
|
|
765
|
+
instructions: 38
|
|
1067
766
|
---
|
|
1068
767
|
|
|
1069
768
|
# Add Fact
|
|
@@ -1090,7 +789,7 @@ The fact is about **infrastructure, services, environments, URLs, endpoints, cre
|
|
|
1090
789
|
### \`docs/context/dangerous-assumptions.md\`
|
|
1091
790
|
The fact is about **something an AI agent might get wrong -- a false assumption that leads to bad outcomes**.
|
|
1092
791
|
- Signal words: "assumes", "might think", "but actually", "looks like X but is Y", "not what it seems", "trap", "gotcha"
|
|
1093
|
-
- Examples: "The
|
|
792
|
+
- Examples: "The \`users\` table looks like a test table but it's production", "Deleting a workspace doesn't delete the billing subscription"
|
|
1094
793
|
|
|
1095
794
|
### \`docs/context/decision-log.md\`
|
|
1096
795
|
The fact is about **an architectural or tooling choice and why it was made**.
|
|
@@ -1228,6 +927,7 @@ Routed to [chosen doc] -- move to [alternative doc] if this is more about [alter
|
|
|
1228
927
|
"joycraft-lockdown.md": `---
|
|
1229
928
|
name: joycraft-lockdown
|
|
1230
929
|
description: Generate constrained execution boundaries for an implementation session -- NEVER rules and deny patterns to prevent agent overreach
|
|
930
|
+
instructions: 28
|
|
1231
931
|
---
|
|
1232
932
|
|
|
1233
933
|
# Lockdown Mode
|
|
@@ -1300,15 +1000,15 @@ Review these suggestions and add them to your project:
|
|
|
1300
1000
|
|
|
1301
1001
|
### CLAUDE.md -- add to NEVER section:
|
|
1302
1002
|
|
|
1303
|
-
- Edit any file in
|
|
1304
|
-
- Run
|
|
1305
|
-
- Use
|
|
1003
|
+
- Edit any file in \`[user's test directories]\`
|
|
1004
|
+
- Run \`[denied package manager commands]\`
|
|
1005
|
+
- Use \`[denied network tools]\`
|
|
1306
1006
|
- Read log files directly -- interact with logs only through test assertions
|
|
1307
1007
|
- [Any additional NEVER rules based on user responses]
|
|
1308
1008
|
|
|
1309
1009
|
### .claude/settings.json -- suggested deny patterns:
|
|
1310
1010
|
|
|
1311
|
-
Add these to the
|
|
1011
|
+
Add these to the \`permissions.deny\` array:
|
|
1312
1012
|
|
|
1313
1013
|
["[command1]", "[command2]", "[command3]"]
|
|
1314
1014
|
|
|
@@ -1329,17 +1029,17 @@ After generating the boundaries above, also recommend a Claude Code permission m
|
|
|
1329
1029
|
\`\`\`
|
|
1330
1030
|
### Recommended Permission Mode
|
|
1331
1031
|
|
|
1332
|
-
You don't need
|
|
1032
|
+
You don't need \`--dangerously-skip-permissions\`. Safer alternatives exist:
|
|
1333
1033
|
|
|
1334
1034
|
| Your situation | Use | Why |
|
|
1335
1035
|
|---|---|---|
|
|
1336
|
-
| Autonomous spec execution |
|
|
1337
|
-
| Long session with some trust |
|
|
1338
|
-
| Interactive development |
|
|
1036
|
+
| Autonomous spec execution | \`--permission-mode dontAsk\` + allowlist above | Only pre-approved commands run |
|
|
1037
|
+
| Long session with some trust | \`--permission-mode auto\` | Safety classifier reviews each action |
|
|
1038
|
+
| Interactive development | \`--permission-mode acceptEdits\` | Auto-approves file edits, prompts for commands |
|
|
1339
1039
|
|
|
1340
|
-
**For lockdown mode, we recommend
|
|
1040
|
+
**For lockdown mode, we recommend \`--permission-mode dontAsk\`** combined with the deny patterns above. This gives you full autonomy for allowed operations while blocking everything else -- no classifier overhead, no prompts, and no safety bypass.
|
|
1341
1041
|
|
|
1342
|
-
|
|
1042
|
+
\`--dangerously-skip-permissions\` disables ALL safety checks. The modes above give you autonomy without removing the guardrails.
|
|
1343
1043
|
\`\`\`
|
|
1344
1044
|
|
|
1345
1045
|
## Step 4: Offer to Apply
|
|
@@ -1354,6 +1054,7 @@ If the user asks you to apply the changes:
|
|
|
1354
1054
|
"joycraft-verify.md": `---
|
|
1355
1055
|
name: joycraft-verify
|
|
1356
1056
|
description: Spawn an independent verifier subagent to check an implementation against its spec -- read-only, no code edits, structured pass/fail verdict
|
|
1057
|
+
instructions: 30
|
|
1357
1058
|
---
|
|
1358
1059
|
|
|
1359
1060
|
# Verify Implementation Against Spec
|
|
@@ -1493,6 +1194,362 @@ Based on the verdict:
|
|
|
1493
1194
|
| Subagent can't run tests (missing deps) | Report the error as FAIL evidence |
|
|
1494
1195
|
| No specs found and no path given | Tell user to provide a spec path or create a spec first |
|
|
1495
1196
|
| Spec status is "Complete" | Still run verification -- "Complete" means the implementer thinks it's done, verification confirms |
|
|
1197
|
+
`,
|
|
1198
|
+
"joycraft-bugfix.md": `---
|
|
1199
|
+
name: joycraft-bugfix
|
|
1200
|
+
description: Structured bug fix workflow \u2014 triage, diagnose, discuss with user, write a focused spec, hand off for implementation
|
|
1201
|
+
instructions: 32
|
|
1202
|
+
---
|
|
1203
|
+
|
|
1204
|
+
# Bug Fix Workflow
|
|
1205
|
+
|
|
1206
|
+
You are fixing a bug. Follow this process in order. Do not skip steps.
|
|
1207
|
+
|
|
1208
|
+
**Guard clause:** If this is clearly a new feature, redirect to \`/joycraft-new-feature\` and stop.
|
|
1209
|
+
|
|
1210
|
+
---
|
|
1211
|
+
|
|
1212
|
+
## Phase 1: Triage
|
|
1213
|
+
|
|
1214
|
+
Establish what's broken. Gather: symptom, steps to reproduce, expected vs actual behavior, when it started, relevant logs/errors. If an error message or stack trace is provided, read the referenced files immediately. Try to reproduce if steps are given.
|
|
1215
|
+
|
|
1216
|
+
**Done when:** You can describe the symptom in one sentence.
|
|
1217
|
+
|
|
1218
|
+
---
|
|
1219
|
+
|
|
1220
|
+
## Phase 2: Diagnose
|
|
1221
|
+
|
|
1222
|
+
Find the root cause. Start from the error site and trace backward. Read source files \u2014 don't guess. Identify the specific line(s) and logic error. Check git blame if it's a recent regression.
|
|
1223
|
+
|
|
1224
|
+
**Done when:** You can explain what's wrong, why, and where in 2-3 sentences.
|
|
1225
|
+
|
|
1226
|
+
---
|
|
1227
|
+
|
|
1228
|
+
## Phase 3: Discuss
|
|
1229
|
+
|
|
1230
|
+
Present findings to the user BEFORE writing any code or spec:
|
|
1231
|
+
1. **Symptom** \u2014 confirm it matches what they see
|
|
1232
|
+
2. **Root cause** \u2014 specific file(s) and line(s)
|
|
1233
|
+
3. **Proposed fix** \u2014 what changes, where
|
|
1234
|
+
4. **Risk** \u2014 side effects? scope?
|
|
1235
|
+
|
|
1236
|
+
Ask: "Does this match? Comfortable with this approach?" If large/risky, suggest decomposing into multiple specs.
|
|
1237
|
+
|
|
1238
|
+
**Done when:** User agrees with the diagnosis and fix direction.
|
|
1239
|
+
|
|
1240
|
+
---
|
|
1241
|
+
|
|
1242
|
+
## Phase 4: Spec the Fix
|
|
1243
|
+
|
|
1244
|
+
Write a bug fix spec to \`docs/specs/YYYY-MM-DD-bugfix-name.md\`. Create the \`docs/specs/\` directory if it doesn't exist.
|
|
1245
|
+
|
|
1246
|
+
**Why:** Even bug fixes deserve a spec. It forces clarity on what "fixed" means, ensures test-first discipline, and creates a traceable record of the fix.
|
|
1247
|
+
|
|
1248
|
+
Use this template:
|
|
1249
|
+
|
|
1250
|
+
\`\`\`markdown
|
|
1251
|
+
# Fix [Bug Description] \u2014 Bug Fix Spec
|
|
1252
|
+
|
|
1253
|
+
> **Parent Brief:** none (bug fix)
|
|
1254
|
+
> **Issue/Error:** [error message, issue link, or symptom description]
|
|
1255
|
+
> **Status:** Ready
|
|
1256
|
+
> **Date:** YYYY-MM-DD
|
|
1257
|
+
> **Estimated scope:** [1 session / N files / ~N lines]
|
|
1258
|
+
|
|
1259
|
+
---
|
|
1260
|
+
|
|
1261
|
+
## Bug
|
|
1262
|
+
|
|
1263
|
+
What is broken? Describe the symptom the user experiences.
|
|
1264
|
+
|
|
1265
|
+
## Root Cause
|
|
1266
|
+
|
|
1267
|
+
What is wrong in the code and why? Name the specific file(s) and line(s).
|
|
1268
|
+
|
|
1269
|
+
## Fix
|
|
1270
|
+
|
|
1271
|
+
What changes will fix this? Be specific \u2014 describe the code change, not just "fix the bug."
|
|
1272
|
+
|
|
1273
|
+
## Acceptance Criteria
|
|
1274
|
+
|
|
1275
|
+
- [ ] [The bug no longer occurs \u2014 describe the correct behavior]
|
|
1276
|
+
- [ ] [No regressions in related functionality]
|
|
1277
|
+
- [ ] Build passes
|
|
1278
|
+
- [ ] Tests pass
|
|
1279
|
+
|
|
1280
|
+
## Test Plan
|
|
1281
|
+
|
|
1282
|
+
| Acceptance Criterion | Test | Type |
|
|
1283
|
+
|---------------------|------|------|
|
|
1284
|
+
| [Bug no longer occurs] | [Test that reproduces the bug, then verifies the fix] | [unit/integration/e2e] |
|
|
1285
|
+
| [No regressions] | [Existing tests still pass, or new regression test] | [unit/integration] |
|
|
1286
|
+
|
|
1287
|
+
**Execution order:**
|
|
1288
|
+
1. Write a test that reproduces the bug \u2014 it should FAIL (red)
|
|
1289
|
+
2. Run the test to confirm it fails
|
|
1290
|
+
3. Apply the fix
|
|
1291
|
+
4. Run the test to confirm it passes (green)
|
|
1292
|
+
5. Run the full test suite to check for regressions
|
|
1293
|
+
|
|
1294
|
+
**Smoke test:** [The bug reproduction test \u2014 fastest way to verify the fix works]
|
|
1295
|
+
|
|
1296
|
+
**Before implementing, verify your test harness:**
|
|
1297
|
+
1. Run the reproduction test \u2014 it must FAIL (if it passes, you're not testing the actual bug)
|
|
1298
|
+
2. The test must exercise your actual code \u2014 not a reimplementation or mock
|
|
1299
|
+
3. Identify your smoke test \u2014 it must run in seconds, not minutes
|
|
1300
|
+
|
|
1301
|
+
## Constraints
|
|
1302
|
+
|
|
1303
|
+
- MUST: [any hard requirements for the fix]
|
|
1304
|
+
- MUST NOT: [any prohibitions \u2014 e.g., don't change the public API]
|
|
1305
|
+
|
|
1306
|
+
## Affected Files
|
|
1307
|
+
|
|
1308
|
+
| Action | File | What Changes |
|
|
1309
|
+
|--------|------|-------------|
|
|
1310
|
+
|
|
1311
|
+
## Edge Cases
|
|
1312
|
+
|
|
1313
|
+
| Scenario | Expected Behavior |
|
|
1314
|
+
|----------|------------------|
|
|
1315
|
+
\`\`\`
|
|
1316
|
+
|
|
1317
|
+
**For trivial bugs:** The spec will be short. That's fine \u2014 the structure is the point, not the length.
|
|
1318
|
+
|
|
1319
|
+
**For large bugs that span multiple files/systems:** Consider whether this should be decomposed into multiple specs. If so, create a brief first using \`/joycraft-new-feature\`, then decompose. A bug fix spec should be implementable in a single session.
|
|
1320
|
+
|
|
1321
|
+
---
|
|
1322
|
+
|
|
1323
|
+
## Phase 5: Hand Off
|
|
1324
|
+
|
|
1325
|
+
Tell the user:
|
|
1326
|
+
|
|
1327
|
+
\`\`\`
|
|
1328
|
+
Bug fix spec is ready: docs/specs/YYYY-MM-DD-bugfix-name.md
|
|
1329
|
+
|
|
1330
|
+
Summary:
|
|
1331
|
+
- Bug: [one sentence]
|
|
1332
|
+
- Root cause: [one sentence]
|
|
1333
|
+
- Fix: [one sentence]
|
|
1334
|
+
- Estimated: 1 session
|
|
1335
|
+
|
|
1336
|
+
To execute: Start a fresh session and:
|
|
1337
|
+
1. Read the spec
|
|
1338
|
+
2. Write the reproduction test (must fail)
|
|
1339
|
+
3. Apply the fix (test must pass)
|
|
1340
|
+
4. Run full test suite
|
|
1341
|
+
5. Run /joycraft-session-end to capture discoveries
|
|
1342
|
+
6. Commit and PR
|
|
1343
|
+
|
|
1344
|
+
Ready to start?
|
|
1345
|
+
\`\`\`
|
|
1346
|
+
|
|
1347
|
+
**Why:** A fresh session for implementation produces better results. This diagnostic session has context noise from exploration \u2014 a clean session with just the spec is more focused.
|
|
1348
|
+
`,
|
|
1349
|
+
"joycraft-design.md": `---
|
|
1350
|
+
name: joycraft-design
|
|
1351
|
+
description: Design discussion before decomposition \u2014 produce a ~200-line design artifact for human review, catching wrong assumptions before they propagate into specs
|
|
1352
|
+
---
|
|
1353
|
+
|
|
1354
|
+
# Design Discussion
|
|
1355
|
+
|
|
1356
|
+
You are producing a design discussion document for a feature. This sits between research and decomposition \u2014 it captures your understanding so the human can catch wrong assumptions before specs are written.
|
|
1357
|
+
|
|
1358
|
+
**Guard clause:** If no brief path is provided and no brief exists in \`docs/briefs/\`, say:
|
|
1359
|
+
"No feature brief found. Run \`/joycraft-new-feature\` first to create one, or provide the path to your brief."
|
|
1360
|
+
Then stop.
|
|
1361
|
+
|
|
1362
|
+
---
|
|
1363
|
+
|
|
1364
|
+
## Step 1: Read Inputs
|
|
1365
|
+
|
|
1366
|
+
Read the feature brief at the path the user provides. If the user also provides a research document path, read that too. Research is optional \u2014 if none exists, note that you'll explore the codebase directly.
|
|
1367
|
+
|
|
1368
|
+
## Step 2: Explore the Codebase
|
|
1369
|
+
|
|
1370
|
+
Spawn subagents to explore the codebase for patterns relevant to the brief. Focus on:
|
|
1371
|
+
|
|
1372
|
+
- Files and functions that will be touched or extended
|
|
1373
|
+
- Existing patterns this feature should follow (naming, data flow, error handling)
|
|
1374
|
+
- Similar features already implemented that serve as models
|
|
1375
|
+
- Boundaries and interfaces the feature must integrate with
|
|
1376
|
+
|
|
1377
|
+
Gather file paths, function signatures, and code snippets. You need concrete evidence, not guesses.
|
|
1378
|
+
|
|
1379
|
+
## Step 3: Write the Design Document
|
|
1380
|
+
|
|
1381
|
+
Create \`docs/designs/\` directory if it doesn't exist. Write the design document to \`docs/designs/YYYY-MM-DD-feature-name.md\`.
|
|
1382
|
+
|
|
1383
|
+
The document has exactly five sections:
|
|
1384
|
+
|
|
1385
|
+
### Section 1: Current State
|
|
1386
|
+
|
|
1387
|
+
What exists today in the codebase that is relevant to this feature. Include file paths, function signatures, and data flows. Be specific \u2014 reference actual code, not abstractions. If no research doc was provided, note that and describe what you found through direct exploration.
|
|
1388
|
+
|
|
1389
|
+
### Section 2: Desired End State
|
|
1390
|
+
|
|
1391
|
+
What the codebase should look like when this feature is complete. Describe the change at a high level \u2014 new files, modified interfaces, new data flows. Do NOT include implementation steps. This is the "what," not the "how."
|
|
1392
|
+
|
|
1393
|
+
### Section 3: Patterns to Follow
|
|
1394
|
+
|
|
1395
|
+
Existing patterns in the codebase that this feature should match. Include short code snippets and \`file:line\` references. Show the pattern, don't just name it.
|
|
1396
|
+
|
|
1397
|
+
If this is a greenfield project with no existing patterns, propose conventions and note that no precedent exists.
|
|
1398
|
+
|
|
1399
|
+
### Section 4: Resolved Design Decisions
|
|
1400
|
+
|
|
1401
|
+
Decisions you have already made, with brief rationale. Format each as:
|
|
1402
|
+
|
|
1403
|
+
> **Decision:** [what you decided]
|
|
1404
|
+
> **Rationale:** [why, referencing existing code or constraints]
|
|
1405
|
+
> **Alternative rejected:** [what you considered and why you rejected it]
|
|
1406
|
+
|
|
1407
|
+
### Section 5: Open Questions
|
|
1408
|
+
|
|
1409
|
+
Things you don't know or where multiple valid approaches exist. Each question MUST present 2-3 concrete options with pros and cons. Format:
|
|
1410
|
+
|
|
1411
|
+
> **Q: [question]**
|
|
1412
|
+
> - **Option A:** [description] \u2014 Pro: [benefit]. Con: [cost].
|
|
1413
|
+
> - **Option B:** [description] \u2014 Pro: [benefit]. Con: [cost].
|
|
1414
|
+
> - **Option C (if applicable):** [description] \u2014 Pro: [benefit]. Con: [cost].
|
|
1415
|
+
|
|
1416
|
+
Do NOT ask vague questions like "what do you think?" Every question must have actionable options the human can choose from.
|
|
1417
|
+
|
|
1418
|
+
## Step 4: Present and STOP
|
|
1419
|
+
|
|
1420
|
+
Present the design document to the user. Say:
|
|
1421
|
+
|
|
1422
|
+
\`\`\`
|
|
1423
|
+
Design discussion written to docs/designs/YYYY-MM-DD-feature-name.md
|
|
1424
|
+
|
|
1425
|
+
Please review the document above. Specifically:
|
|
1426
|
+
1. Are the patterns in Section 3 the right ones to follow, or should I use different ones?
|
|
1427
|
+
2. Do you agree with the resolved decisions in Section 4?
|
|
1428
|
+
3. Pick an option for each open question in Section 5 (or propose your own).
|
|
1429
|
+
|
|
1430
|
+
Reply with your feedback. I will NOT proceed to decomposition until you have reviewed and approved this design.
|
|
1431
|
+
\`\`\`
|
|
1432
|
+
|
|
1433
|
+
**CRITICAL: Do NOT proceed to \`/joycraft-decompose\` or generate specs.** Wait for the human to review, answer open questions, and correct any wrong assumptions. The entire value of this skill is the pause \u2014 it forces a human checkpoint before mistakes propagate.
|
|
1434
|
+
|
|
1435
|
+
## After Human Review
|
|
1436
|
+
|
|
1437
|
+
Once the human responds:
|
|
1438
|
+
- Update the design document with their corrections and chosen options
|
|
1439
|
+
- Move answered questions from "Open Questions" to "Resolved Design Decisions"
|
|
1440
|
+
- Present the updated document for final confirmation
|
|
1441
|
+
- Only after explicit approval, tell the user: "Design approved. Run \`/joycraft-decompose\` with this brief to generate atomic specs."
|
|
1442
|
+
`,
|
|
1443
|
+
"joycraft-research.md": `---
|
|
1444
|
+
name: joycraft-research
|
|
1445
|
+
description: Produce objective codebase research by isolating question generation from fact-gathering \u2014 subagent sees only questions, never the brief
|
|
1446
|
+
---
|
|
1447
|
+
|
|
1448
|
+
# Research Codebase for a Feature
|
|
1449
|
+
|
|
1450
|
+
You are producing objective codebase research to inform a future spec or implementation. The key insight: the researching agent must never see the brief or ticket \u2014 only research questions. This prevents opinions from contaminating the facts.
|
|
1451
|
+
|
|
1452
|
+
**Guard clause:** If the user doesn't provide a brief path or inline description, ask:
|
|
1453
|
+
"What feature or change are you researching? Provide a brief path (e.g., \`docs/briefs/2026-03-30-my-feature.md\`) or describe it in a few sentences."
|
|
1454
|
+
|
|
1455
|
+
---
|
|
1456
|
+
|
|
1457
|
+
## Phase 1: Generate Research Questions
|
|
1458
|
+
|
|
1459
|
+
Read the brief file (if a path was provided) or use the user's inline description.
|
|
1460
|
+
|
|
1461
|
+
Identify which zones of the codebase are relevant to this feature. Then generate 5-10 research questions that are:
|
|
1462
|
+
|
|
1463
|
+
- **Objective and fact-seeking** \u2014 "How does X work?" not "How should we build X?"
|
|
1464
|
+
- **Specific to the codebase** \u2014 reference concrete systems, files, or flows
|
|
1465
|
+
- **Answerable by reading code** \u2014 no questions about business strategy or user preferences
|
|
1466
|
+
|
|
1467
|
+
Good examples:
|
|
1468
|
+
- "How does endpoint registration work in the current router?"
|
|
1469
|
+
- "What patterns exist for input validation across existing handlers?"
|
|
1470
|
+
- "Trace the data flow from API request to database write for entity X."
|
|
1471
|
+
- "What test infrastructure exists? Where are fixtures, mocks, and helpers?"
|
|
1472
|
+
- "What dependencies does module Y import, and what does its public API look like?"
|
|
1473
|
+
|
|
1474
|
+
Bad examples (do NOT generate these):
|
|
1475
|
+
- "What's the best way to implement this feature?" (opinion)
|
|
1476
|
+
- "Should we use library X or Y?" (recommendation)
|
|
1477
|
+
- "What would a good architecture look like?" (design, not research)
|
|
1478
|
+
|
|
1479
|
+
Write the questions to a temporary file at \`docs/research/.questions-tmp.md\`. Create the \`docs/research/\` directory if it doesn't exist.
|
|
1480
|
+
|
|
1481
|
+
**Do NOT include any content from the brief in this file \u2014 only the questions.**
|
|
1482
|
+
|
|
1483
|
+
---
|
|
1484
|
+
|
|
1485
|
+
## Phase 2: Spawn Research Subagent
|
|
1486
|
+
|
|
1487
|
+
Use Claude Code's Agent tool to spawn a subagent. Pass ONLY the research questions \u2014 never the brief path, brief content, or feature description.
|
|
1488
|
+
|
|
1489
|
+
Build the subagent prompt by reading the questions file you just wrote, then use this template:
|
|
1490
|
+
|
|
1491
|
+
\`\`\`
|
|
1492
|
+
You are researching a codebase to answer specific questions. You have NO context about why these questions are being asked \u2014 you are simply gathering facts.
|
|
1493
|
+
|
|
1494
|
+
RULES \u2014 these are hard constraints:
|
|
1495
|
+
- Answer each question with FACTS ONLY: file paths, function signatures, data flows, patterns, dependencies
|
|
1496
|
+
- Do NOT recommend, suggest, or opine on anything
|
|
1497
|
+
- Do NOT speculate about what should be built or how
|
|
1498
|
+
- If a question cannot be answered (no relevant code exists), say "No existing code found for this"
|
|
1499
|
+
- Use the Read tool and Grep tool to explore the codebase thoroughly
|
|
1500
|
+
- Include code snippets only when they are essential evidence (e.g., a function signature, a config block)
|
|
1501
|
+
|
|
1502
|
+
QUESTIONS:
|
|
1503
|
+
[INSERT_QUESTIONS_HERE]
|
|
1504
|
+
|
|
1505
|
+
OUTPUT FORMAT \u2014 write your findings as a single markdown document using this structure:
|
|
1506
|
+
|
|
1507
|
+
# Codebase Research
|
|
1508
|
+
|
|
1509
|
+
**Date:** [today's date]
|
|
1510
|
+
**Questions answered:** [N/total]
|
|
1511
|
+
|
|
1512
|
+
---
|
|
1513
|
+
|
|
1514
|
+
## Q1: [question text]
|
|
1515
|
+
|
|
1516
|
+
[Facts, file paths, function signatures, data flows. No opinions.]
|
|
1517
|
+
|
|
1518
|
+
## Q2: [question text]
|
|
1519
|
+
|
|
1520
|
+
[Facts, file paths, function signatures, data flows. No opinions.]
|
|
1521
|
+
|
|
1522
|
+
[Continue for all questions]
|
|
1523
|
+
\`\`\`
|
|
1524
|
+
|
|
1525
|
+
## Phase 3: Write the Research Document
|
|
1526
|
+
|
|
1527
|
+
Take the subagent's response and write it to \`docs/research/YYYY-MM-DD-feature-name.md\`. Derive the feature name from the brief filename or the user's description (lowercase, hyphenated).
|
|
1528
|
+
|
|
1529
|
+
Delete the temporary questions file (\`docs/research/.questions-tmp.md\`).
|
|
1530
|
+
|
|
1531
|
+
Present the research document path to the user:
|
|
1532
|
+
|
|
1533
|
+
\`\`\`
|
|
1534
|
+
Research complete: docs/research/YYYY-MM-DD-feature-name.md
|
|
1535
|
+
|
|
1536
|
+
This document contains objective facts about your codebase \u2014 no opinions or recommendations.
|
|
1537
|
+
|
|
1538
|
+
Next steps:
|
|
1539
|
+
- /joycraft-decompose \u2014 break the feature into atomic specs (research will inform the specs)
|
|
1540
|
+
- /joycraft-new-feature \u2014 formalize into a full Feature Brief first
|
|
1541
|
+
- Read the research and add any corrections or missing context manually
|
|
1542
|
+
\`\`\`
|
|
1543
|
+
|
|
1544
|
+
## Edge Cases
|
|
1545
|
+
|
|
1546
|
+
| Scenario | Behavior |
|
|
1547
|
+
|----------|----------|
|
|
1548
|
+
| No brief provided | Accept inline description, generate questions from that |
|
|
1549
|
+
| Codebase is empty or new | Research doc reports "no existing patterns found" per question |
|
|
1550
|
+
| User runs research twice for same feature | Overwrites previous research doc (same filename) |
|
|
1551
|
+
| Brief is very short (1-2 sentences) | Still generate questions \u2014 even simple features benefit from understanding existing patterns |
|
|
1552
|
+
| \`docs/research/\` doesn't exist | Create it |
|
|
1496
1553
|
`
|
|
1497
1554
|
};
|
|
1498
1555
|
var TEMPLATES = {
|
|
@@ -3295,4 +3352,4 @@ export {
|
|
|
3295
3352
|
SKILLS,
|
|
3296
3353
|
TEMPLATES
|
|
3297
3354
|
};
|
|
3298
|
-
//# sourceMappingURL=chunk-
|
|
3355
|
+
//# sourceMappingURL=chunk-T62ZHD3N.js.map
|