@buoy-design/cli 0.2.20 → 0.2.21

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.
Files changed (45) hide show
  1. package/README.md +4 -4
  2. package/dist/commands/ahoy.d.ts +14 -0
  3. package/dist/commands/ahoy.d.ts.map +1 -0
  4. package/dist/commands/ahoy.js +355 -0
  5. package/dist/commands/ahoy.js.map +1 -0
  6. package/dist/commands/begin.js +5 -5
  7. package/dist/commands/begin.js.map +1 -1
  8. package/dist/commands/billing.js +4 -4
  9. package/dist/commands/check.js +1 -1
  10. package/dist/commands/dock.d.ts.map +1 -1
  11. package/dist/commands/dock.js +44 -35
  12. package/dist/commands/dock.js.map +1 -1
  13. package/dist/commands/index.d.ts +1 -1
  14. package/dist/commands/index.js +2 -2
  15. package/dist/commands/link.js +1 -1
  16. package/dist/commands/plans.js +1 -1
  17. package/dist/commands/plans.js.map +1 -1
  18. package/dist/commands/sync.js +1 -1
  19. package/dist/commands/whoami.js +2 -2
  20. package/dist/index.js +5 -5
  21. package/dist/index.js.map +1 -1
  22. package/dist/integrations/github-formatter.js +2 -2
  23. package/dist/integrations/github-formatter.js.map +1 -1
  24. package/dist/output/formatters.js +1 -1
  25. package/dist/output/pr-comment-preview.js +1 -1
  26. package/dist/services/architect.js +1 -1
  27. package/dist/services/architect.js.map +1 -1
  28. package/dist/services/drift-analysis.d.ts +6 -0
  29. package/dist/services/drift-analysis.d.ts.map +1 -1
  30. package/dist/services/drift-analysis.js +36 -2
  31. package/dist/services/drift-analysis.js.map +1 -1
  32. package/dist/store/local-store.d.ts +19 -14
  33. package/dist/store/local-store.d.ts.map +1 -1
  34. package/dist/store/local-store.js +59 -341
  35. package/dist/store/local-store.js.map +1 -1
  36. package/dist/templates/agents.d.ts +22 -0
  37. package/dist/templates/agents.d.ts.map +1 -0
  38. package/dist/templates/agents.js +264 -0
  39. package/dist/templates/agents.js.map +1 -0
  40. package/dist/utils/upgrade-hints.js +5 -5
  41. package/dist/wizard/ci-generator.js +3 -3
  42. package/dist/wizard/ci-generator.js.map +1 -1
  43. package/package.json +17 -18
  44. package/LICENSE +0 -21
  45. package/assets/commands/contribution-loop.md +0 -195
@@ -1,195 +0,0 @@
1
- ---
2
- name: contribution-loop
3
- description: Find repos with design drift and generate meaningful PRs to fix them. Runs as an autonomous loop discovering GitHub repos using design systems, scanning for drift, and staging fixes for human review.
4
- ---
5
-
6
- # Contribution Loop
7
-
8
- Autonomously find real-world apps using design systems (Chakra, Tailwind, shadcn, Radix, etc.), scan for design drift, and generate high-quality PRs to fix them.
9
-
10
- ## Philosophy
11
-
12
- This is NOT about drive-by improvements. Each PR must:
13
- - Explain WHY the fix matters with full context
14
- - Reference git history showing whether drift was intentional or accidental
15
- - Be something you could defend with conviction
16
- - Include subtle Buoy attribution to demonstrate value
17
-
18
- ## The Loop
19
-
20
- ```
21
- Discovery → Scanning → Analysis → Triage → Generation → Review → Tracking
22
- ```
23
-
24
- ### 1. Discovery Phase
25
-
26
- Find candidates using GitHub search:
27
- ```
28
- "from '@chakra-ui" language:TypeScript stars:>100 pushed:>2024-01-01
29
- "tailwind.config" language:JavaScript stars:>50 fork:false
30
- ```
31
-
32
- **Criteria:**
33
- - Applications, NOT framework libraries (no design system source code)
34
- - Active maintenance (commits in last 6 months)
35
- - Uses a design system as a dependency
36
- - Has clear CONTRIBUTING.md or open to external PRs
37
-
38
- ### 2. Scanning Phase
39
-
40
- Run Buoy scan on the repo:
41
- ```bash
42
- buoy sweep --json
43
- ```
44
-
45
- Look for:
46
- - Hardcoded colors that should be tokens
47
- - Inconsistent spacing values
48
- - Deprecated pattern usage
49
- - Component drift from design system
50
-
51
- ### 3. Analysis Phase
52
-
53
- Use the agents from `@buoy-design/agents`:
54
-
55
- 1. **HistoryAgent** - Check git blame: Was this intentional?
56
- 2. **ReviewAgent** - Did Buoy miss anything obvious?
57
- 3. **AcceptanceAgent** - Will this repo accept external PRs?
58
- - **IMPORTANT**: Check the `contributionProcess` in the response
59
- - If `issueRequired: true` or `preferredFlow: 'issue-then-pr'`, open issue first
60
- - If `directPRsAllowed: 'small-fixes'`, design fixes are usually acceptable
61
- 4. **FixabilityAgent** - Tier each signal: slam-dunk, review, or skip
62
-
63
- ### 4. Triage Phase
64
-
65
- Classify signals:
66
- - **slam-dunk**: Clear mistake, token exists, safe to fix
67
- - **review**: Probably fixable, needs human judgment
68
- - **skip**: Intentional, risky, or too complex
69
-
70
- Only proceed with repos that have slam-dunk fixes.
71
-
72
- ### 5. Generation Phase
73
-
74
- Use **GeneratorAgent** to create:
75
- - Exact code fixes (before/after)
76
- - Compelling PR title
77
- - Full PR description with context
78
-
79
- PR body format:
80
- ```markdown
81
- ## Summary
82
- Brief description of what this PR does.
83
-
84
- ## Why This Matters
85
- - Maintainability: Easier to update colors globally
86
- - Consistency: Matches other components using tokens
87
- - Theming: Enables dark mode/theme switching
88
-
89
- ## Changes
90
- - `Button.tsx:23`: Use `colors.primary.500` instead of `#3182ce`
91
- - `Card.tsx:45`: Use `spacing.4` instead of `16px`
92
-
93
- ## Context
94
- Git history shows these were introduced in commit abc123 during
95
- a rapid feature sprint - likely accidental rather than intentional.
96
-
97
- ## Cherry-picking
98
- If you prefer, you can cherry-pick individual changes:
99
- - Commit xyz789 updates Button.tsx only
100
-
101
- ---
102
- *Found with [Buoy](https://github.com/buoy-design/buoy) - design drift detection for AI-generated code.*
103
- ```
104
-
105
- ### 6. Review Phase
106
-
107
- Stage PRs for human review before submission:
108
- 1. Show diff and PR body
109
- 2. Allow edit/approve/reject
110
- 3. Only submit approved PRs
111
-
112
- ### 7. Tracking Phase
113
-
114
- Track outcomes to improve:
115
- - Which PRs got merged?
116
- - What patterns got rejected?
117
- - Which repos are good targets?
118
-
119
- ## Agent Usage
120
-
121
- ```typescript
122
- import {
123
- HistoryAgent,
124
- ReviewAgent,
125
- AcceptanceAgent,
126
- FixabilityAgent,
127
- GeneratorAgent
128
- } from '@buoy-design/agents';
129
-
130
- // Initialize agents
131
- const history = new HistoryAgent();
132
- const review = new ReviewAgent();
133
- const acceptance = new AcceptanceAgent();
134
- const fixability = new FixabilityAgent();
135
- const generator = new GeneratorAgent();
136
-
137
- // For each drift signal
138
- const historyResult = await history.analyze({
139
- repo: { path: './repo', owner: 'org', name: 'app' },
140
- signal: driftSignal,
141
- blameRange: { start: 20, end: 25 }
142
- });
143
-
144
- // Assess fixability
145
- const fixResult = await fixability.assess({
146
- signal: driftSignal,
147
- fileContent: '...',
148
- historyContext: historyResult.data
149
- });
150
-
151
- // Generate fixes for slam-dunks
152
- if (fixResult.data.tier === 'slam-dunk') {
153
- const prResult = await generator.generate({
154
- repo: { owner: 'org', name: 'app' },
155
- signals: [{ signal: driftSignal, fixability: fixResult.data, history: historyResult.data }],
156
- acceptanceContext: acceptanceResult.data,
157
- designTokens: tokens
158
- });
159
- }
160
- ```
161
-
162
- ## State Management
163
-
164
- Track contribution state in `.buoy/contributions.json`:
165
- ```json
166
- {
167
- "repos": {
168
- "org/app": {
169
- "lastScanned": "2024-01-15",
170
- "prsSubmitted": ["#123"],
171
- "prsAccepted": ["#123"],
172
- "status": "contributed"
173
- }
174
- },
175
- "stats": {
176
- "reposScanned": 45,
177
- "prsSubmitted": 12,
178
- "prsAccepted": 8
179
- }
180
- }
181
- ```
182
-
183
- ## Running the Loop
184
-
185
- You *can* use Ralph Wiggum for full autonomous execution—but remember, **your name goes on these PRs**. Best practice is to keep a tight leash on what you're submitting to other people's repos.
186
-
187
- **Safe to let loose:** Discovery → Scanning → Analysis → Triage → Generation
188
- **Best to review:** Submission (your reputation is on the line)
189
-
190
- Run a single iteration:
191
- 1. Find 5 candidate repos
192
- 2. Scan each with Buoy
193
- 3. Analyze signals with agents
194
- 4. Generate PRs for slam-dunks
195
- 5. Review before submitting (recommended)