@winspan/claude-forge 8.51.0 → 8.53.2
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/CLAUDE.md +6 -6
- package/dist/cli/commands/skills.d.ts.map +1 -1
- package/dist/cli/commands/skills.js +115 -0
- package/dist/cli/commands/skills.js.map +1 -1
- package/dist/core/constants.d.ts +2 -0
- package/dist/core/constants.d.ts.map +1 -1
- package/dist/core/constants.js +4 -0
- package/dist/core/constants.js.map +1 -1
- package/dist/daemon/hook-sync.d.ts +17 -0
- package/dist/daemon/hook-sync.d.ts.map +1 -0
- package/dist/daemon/hook-sync.js +74 -0
- package/dist/daemon/hook-sync.js.map +1 -0
- package/dist/daemon/index.d.ts.map +1 -1
- package/dist/daemon/index.js +21 -1
- package/dist/daemon/index.js.map +1 -1
- package/dist/daemon/skill-sync.d.ts +21 -0
- package/dist/daemon/skill-sync.d.ts.map +1 -0
- package/dist/daemon/skill-sync.js +75 -0
- package/dist/daemon/skill-sync.js.map +1 -0
- package/dist/hooks/notification.sh +1 -1
- package/dist/hooks/post-tool-use.sh +1 -1
- package/dist/hooks/pre-tool-use.sh +1 -1
- package/dist/hooks/stop.sh +1 -1
- package/dist/hooks/user-prompt-submit.sh +1 -1
- package/dist/skills/official/code-simplifier.md +37 -1
- package/dist/skills/official/find-skills.md +120 -1
- package/dist/skills/official/official-api-design.md +14 -1
- package/dist/skills/official/official-architecture-decision.md +22 -1
- package/dist/skills/official/official-db-schema-design.md +19 -1
- package/dist/skills/official/official-debug.md +9 -1
- package/dist/skills/official/official-pr-review.md +1 -1
- package/dist/skills/official/official-security-hardening.md +7 -1
- package/dist/skills/official/planning-with-files.md +206 -2
- package/dist/skills/official/ui-ux-pro-max.md +88 -1
- package/dist/skills/official/webapp-testing.md +85 -1
- package/dist/skills/registry.d.ts +1 -1
- package/dist/skills/registry.d.ts.map +1 -1
- package/dist/skills/registry.js +2 -2
- package/dist/skills/registry.js.map +1 -1
- package/dist/skills/semantic-matcher.d.ts +2 -1
- package/dist/skills/semantic-matcher.d.ts.map +1 -1
- package/dist/skills/semantic-matcher.js +6 -3
- package/dist/skills/semantic-matcher.js.map +1 -1
- package/dist/skills/upgrade-engine.d.ts +91 -0
- package/dist/skills/upgrade-engine.d.ts.map +1 -0
- package/dist/skills/upgrade-engine.js +436 -0
- package/dist/skills/upgrade-engine.js.map +1 -0
- package/dist/skills/upgrade-prompt.d.ts +20 -0
- package/dist/skills/upgrade-prompt.d.ts.map +1 -0
- package/dist/skills/upgrade-prompt.js +75 -0
- package/dist/skills/upgrade-prompt.js.map +1 -0
- package/docs/design/skill-ai-upgrade-spec-20260518-1930.md +297 -0
- package/docs/implementation/daemon-skill-sync-changelog-20260518-2000.md +22 -0
- package/docs/implementation/skill-ai-upgrade-changelog-20260518-1930.md +49 -0
- package/package.json +1 -1
- package/src/cli/commands/skills.ts +143 -0
- package/src/core/constants.ts +5 -0
- package/src/daemon/hook-sync.ts +91 -0
- package/src/daemon/index.ts +21 -1
- package/src/daemon/skill-sync.ts +88 -0
- package/src/hooks/notification.sh +1 -1
- package/src/hooks/post-tool-use.sh +1 -1
- package/src/hooks/pre-tool-use.sh +1 -1
- package/src/hooks/stop.sh +1 -1
- package/src/hooks/user-prompt-submit.sh +1 -1
- package/src/skills/official/code-simplifier.md +37 -1
- package/src/skills/official/find-skills.md +120 -1
- package/src/skills/official/official-api-design.md +14 -1
- package/src/skills/official/official-architecture-decision.md +22 -1
- package/src/skills/official/official-db-schema-design.md +19 -1
- package/src/skills/official/official-debug.md +9 -1
- package/src/skills/official/official-pr-review.md +1 -1
- package/src/skills/official/official-security-hardening.md +7 -1
- package/src/skills/official/planning-with-files.md +206 -2
- package/src/skills/official/ui-ux-pro-max.md +88 -1
- package/src/skills/official/webapp-testing.md +85 -1
- package/src/skills/registry.ts +2 -2
- package/src/skills/semantic-matcher.ts +6 -3
- package/src/skills/upgrade-engine.ts +541 -0
- package/src/skills/upgrade-prompt.ts +84 -0
- package/tests/unit/daemon/hook-sync.test.ts +71 -0
- package/tests/unit/daemon/skill-sync.test.ts +75 -0
- package/tests/unit/skills/upgrade-engine-parse.test.ts +138 -0
- package/tests/unit/skills/upgrade-engine.test.ts +401 -0
- package/tests/unit/skills/upgrade-prompt.test.ts +89 -0
|
@@ -15,4 +15,91 @@ Antigravity Kit is an AI-powered design intelligence toolkit providing searchabl
|
|
|
15
15
|
|
|
16
16
|
## Search Command
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
```bash
|
|
19
|
+
python3 src/ui-ux-pro-max/scripts/search.py "<query>" --domain <domain> [-n <max_results>]
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
**Domain search:**
|
|
23
|
+
- `product` - Product type recommendations (SaaS, e-commerce, portfolio)
|
|
24
|
+
- `style` - UI styles (glassmorphism, minimalism, brutalism) + AI prompts and CSS keywords
|
|
25
|
+
- `typography` - Font pairings with Google Fonts imports
|
|
26
|
+
- `color` - Color palettes by product type
|
|
27
|
+
- `landing` - Page structure and CTA strategies
|
|
28
|
+
- `chart` - Chart types and library recommendations
|
|
29
|
+
- `ux` - Best practices and anti-patterns
|
|
30
|
+
|
|
31
|
+
**Stack search:**
|
|
32
|
+
```bash
|
|
33
|
+
python3 src/ui-ux-pro-max/scripts/search.py "<query>" --stack <stack>
|
|
34
|
+
```
|
|
35
|
+
Available stacks: `html-tailwind` (default), `react`, `nextjs`, `astro`, `vue`, `nuxtjs`, `nuxt-ui`, `svelte`, `swiftui`, `react-native`, `flutter`, `shadcn`, `jetpack-compose`
|
|
36
|
+
|
|
37
|
+
## Architecture
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
src/ui-ux-pro-max/ # Source of Truth
|
|
41
|
+
├── data/ # Canonical CSV databases
|
|
42
|
+
│ ├── products.csv, styles.csv, colors.csv, typography.csv, ...
|
|
43
|
+
│ └── stacks/ # Stack-specific guidelines
|
|
44
|
+
├── scripts/
|
|
45
|
+
│ ├── search.py # CLI entry point
|
|
46
|
+
│ ├── core.py # BM25 + regex hybrid search engine
|
|
47
|
+
│ └── design_system.py # Design system generation
|
|
48
|
+
└── templates/
|
|
49
|
+
├── base/ # Base templates (skill-content.md, quick-reference.md)
|
|
50
|
+
└── platforms/ # Platform configs (claude.json, cursor.json, ...)
|
|
51
|
+
|
|
52
|
+
cli/ # CLI installer (uipro-cli on npm)
|
|
53
|
+
├── src/
|
|
54
|
+
│ ├── commands/init.ts # Install command with template generation
|
|
55
|
+
│ └── utils/template.ts # Template rendering engine
|
|
56
|
+
└── assets/ # Bundled assets (~564KB)
|
|
57
|
+
├── data/ # Copy of src/ui-ux-pro-max/data/
|
|
58
|
+
├── scripts/ # Copy of src/ui-ux-pro-max/scripts/
|
|
59
|
+
└── templates/ # Copy of src/ui-ux-pro-max/templates/
|
|
60
|
+
|
|
61
|
+
.claude/skills/ui-ux-pro-max/ # Claude Code skill (symlinks to src/)
|
|
62
|
+
.factory/skills/ui-ux-pro-max/ # Droid (Factory) skill (symlinks to src/)
|
|
63
|
+
.shared/ui-ux-pro-max/ # Symlink to src/ui-ux-pro-max/
|
|
64
|
+
.claude-plugin/ # Claude Marketplace publishing
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
The search engine uses BM25 ranking combined with regex matching. Domain auto-detection is available when `--domain` is omitted.
|
|
68
|
+
|
|
69
|
+
## Sync Rules
|
|
70
|
+
|
|
71
|
+
**Source of Truth:** `src/ui-ux-pro-max/`
|
|
72
|
+
|
|
73
|
+
When modifying files:
|
|
74
|
+
|
|
75
|
+
1. **Data & Scripts** - Edit in `src/ui-ux-pro-max/`:
|
|
76
|
+
- `data/*.csv` and `data/stacks/*.csv`
|
|
77
|
+
- `scripts/*.py`
|
|
78
|
+
- Changes automatically available via symlinks in `.claude/`, `.factory/`, `.shared/`
|
|
79
|
+
|
|
80
|
+
2. **Templates** - Edit in `src/ui-ux-pro-max/templates/`:
|
|
81
|
+
- `base/skill-content.md` - Common SKILL.md content
|
|
82
|
+
- `base/quick-reference.md` - Quick reference section (Claude only)
|
|
83
|
+
- `platforms/*.json` - Platform-specific configs
|
|
84
|
+
|
|
85
|
+
3. **CLI Assets** - Run sync before publishing:
|
|
86
|
+
```bash
|
|
87
|
+
cp -r src/ui-ux-pro-max/data/* cli/assets/data/
|
|
88
|
+
cp -r src/ui-ux-pro-max/scripts/* cli/assets/scripts/
|
|
89
|
+
cp -r src/ui-ux-pro-max/templates/* cli/assets/templates/
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
4. **Reference Folders** - No manual sync needed. The CLI generates these from templates during `uipro init`.
|
|
93
|
+
|
|
94
|
+
## Prerequisites
|
|
95
|
+
|
|
96
|
+
Python 3.x (no external dependencies required)
|
|
97
|
+
|
|
98
|
+
## Git Workflow
|
|
99
|
+
|
|
100
|
+
Never push directly to `main`. Always:
|
|
101
|
+
|
|
102
|
+
1. Create a new branch: `git checkout -b feat/...` or `fix/...`
|
|
103
|
+
2. Commit changes
|
|
104
|
+
3. Push branch: `git push -u origin <branch>`
|
|
105
|
+
4. Create PR: `gh pr create`
|
|
@@ -9,4 +9,88 @@ license: Complete terms in LICENSE.txt
|
|
|
9
9
|
To test local web applications, write native Python Playwright scripts.
|
|
10
10
|
|
|
11
11
|
**Helper Scripts Available**:
|
|
12
|
-
- `
|
|
12
|
+
- `scripts/with_server.py` - Manages server lifecycle (supports multiple servers)
|
|
13
|
+
|
|
14
|
+
**Always run scripts with `--help` first** to see usage. DO NOT read the source until you try running the script first and find that a customized solution is abslutely necessary. These scripts can be very large and thus pollute your context window. They exist to be called directly as black-box scripts rather than ingested into your context window.
|
|
15
|
+
|
|
16
|
+
## Decision Tree: Choosing Your Approach
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
User task → Is it static HTML?
|
|
20
|
+
├─ Yes → Read HTML file directly to identify selectors
|
|
21
|
+
│ ├─ Success → Write Playwright script using selectors
|
|
22
|
+
│ └─ Fails/Incomplete → Treat as dynamic (below)
|
|
23
|
+
│
|
|
24
|
+
└─ No (dynamic webapp) → Is the server already running?
|
|
25
|
+
├─ No → Run: python scripts/with_server.py --help
|
|
26
|
+
│ Then use the helper + write simplified Playwright script
|
|
27
|
+
│
|
|
28
|
+
└─ Yes → Reconnaissance-then-action:
|
|
29
|
+
1. Navigate and wait for networkidle
|
|
30
|
+
2. Take screenshot or inspect DOM
|
|
31
|
+
3. Identify selectors from rendered state
|
|
32
|
+
4. Execute actions with discovered selectors
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Example: Using with_server.py
|
|
36
|
+
|
|
37
|
+
To start a server, run `--help` first, then use the helper:
|
|
38
|
+
|
|
39
|
+
**Single server:**
|
|
40
|
+
```bash
|
|
41
|
+
python scripts/with_server.py --server "npm run dev" --port 5173 -- python your_automation.py
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
**Multiple servers (e.g., backend + frontend):**
|
|
45
|
+
```bash
|
|
46
|
+
python scripts/with_server.py \
|
|
47
|
+
--server "cd backend && python server.py" --port 3000 \
|
|
48
|
+
--server "cd frontend && npm run dev" --port 5173 \
|
|
49
|
+
-- python your_automation.py
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
To create an automation script, include only Playwright logic (servers are managed automatically):
|
|
53
|
+
```python
|
|
54
|
+
from playwright.sync_api import sync_playwright
|
|
55
|
+
|
|
56
|
+
with sync_playwright() as p:
|
|
57
|
+
browser = p.chromium.launch(headless=True) # Always launch chromium in headless mode
|
|
58
|
+
page = browser.new_page()
|
|
59
|
+
page.goto('http://localhost:5173') # Server already running and ready
|
|
60
|
+
page.wait_for_load_state('networkidle') # CRITICAL: Wait for JS to execute
|
|
61
|
+
# ... your automation logic
|
|
62
|
+
browser.close()
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Reconnaissance-Then-Action Pattern
|
|
66
|
+
|
|
67
|
+
1. **Inspect rendered DOM**:
|
|
68
|
+
```python
|
|
69
|
+
page.screenshot(path='/tmp/inspect.png', full_page=True)
|
|
70
|
+
content = page.content()
|
|
71
|
+
page.locator('button').all()
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
2. **Identify selectors** from inspection results
|
|
75
|
+
|
|
76
|
+
3. **Execute actions** using discovered selectors
|
|
77
|
+
|
|
78
|
+
## Common Pitfall
|
|
79
|
+
|
|
80
|
+
❌ **Don't** inspect the DOM before waiting for `networkidle` on dynamic apps
|
|
81
|
+
✅ **Do** wait for `page.wait_for_load_state('networkidle')` before inspection
|
|
82
|
+
|
|
83
|
+
## Best Practices
|
|
84
|
+
|
|
85
|
+
- **Use bundled scripts as black boxes** - To accomplish a task, consider whether one of the scripts available in `scripts/` can help. These scripts handle common, complex workflows reliably without cluttering the context window. Use `--help` to see usage, then invoke directly.
|
|
86
|
+
- Use `sync_playwright()` for synchronous scripts
|
|
87
|
+
- Always close the browser when done
|
|
88
|
+
- Use descriptive selectors: `text=`, `role=`, CSS selectors, or IDs
|
|
89
|
+
- Add appropriate waits: `page.wait_for_selector()` or `page.wait_for_timeout()`
|
|
90
|
+
|
|
91
|
+
## Reference Files
|
|
92
|
+
|
|
93
|
+
- **examples/** - Examples showing common patterns:
|
|
94
|
+
- `element_discovery.py` - Discovering buttons, links, and inputs on a page
|
|
95
|
+
- `static_html_automation.py` - Using file:// URLs for local HTML
|
|
96
|
+
- `console_logging.py` - Capturing console logs during automation
|
package/src/skills/registry.ts
CHANGED
|
@@ -27,12 +27,12 @@ export class SkillRegistry {
|
|
|
27
27
|
private skills: Map<string, Skill> = new Map();
|
|
28
28
|
private semanticMatcher: SemanticSkillMatcher | null = null;
|
|
29
29
|
|
|
30
|
-
constructor(apiKey?: string) {
|
|
30
|
+
constructor(apiKey?: string, model?: string, baseURL?: string) {
|
|
31
31
|
this.scan();
|
|
32
32
|
|
|
33
33
|
// Initialize semantic matcher if API key is provided
|
|
34
34
|
if (apiKey) {
|
|
35
|
-
this.semanticMatcher = new SemanticSkillMatcher(apiKey);
|
|
35
|
+
this.semanticMatcher = new SemanticSkillMatcher(apiKey, model, baseURL);
|
|
36
36
|
logger.info('[SkillRegistry] Semantic matching enabled');
|
|
37
37
|
} else {
|
|
38
38
|
logger.debug('[SkillRegistry] Semantic matching disabled (no API key)');
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
import Anthropic from '@anthropic-ai/sdk';
|
|
7
7
|
import type { Skill } from './registry.js';
|
|
8
8
|
import { logger } from '../core/utils/logger.js';
|
|
9
|
+
import { DEFAULTS } from '../core/constants.js';
|
|
9
10
|
|
|
10
11
|
export interface SemanticMatchResult {
|
|
11
12
|
skill: Skill;
|
|
@@ -25,13 +26,15 @@ export interface SemanticMatchContext {
|
|
|
25
26
|
*/
|
|
26
27
|
export class SemanticSkillMatcher {
|
|
27
28
|
private client: Anthropic | null = null;
|
|
29
|
+
private model: string;
|
|
28
30
|
private cache: Map<string, SemanticMatchResult | null> = new Map();
|
|
29
31
|
private readonly CACHE_TTL = 5 * 60 * 1000; // 5 minutes
|
|
30
32
|
private cacheTimestamps: Map<string, number> = new Map();
|
|
31
33
|
|
|
32
|
-
constructor(apiKey?: string) {
|
|
34
|
+
constructor(apiKey?: string, model?: string, baseURL?: string) {
|
|
35
|
+
this.model = model || DEFAULTS.AI_MODEL;
|
|
33
36
|
if (apiKey) {
|
|
34
|
-
this.client = new Anthropic({ apiKey });
|
|
37
|
+
this.client = new Anthropic({ apiKey, baseURL });
|
|
35
38
|
}
|
|
36
39
|
}
|
|
37
40
|
|
|
@@ -81,7 +84,7 @@ export class SemanticSkillMatcher {
|
|
|
81
84
|
const prompt = this.buildMatchingPrompt(context, skillDescriptions);
|
|
82
85
|
|
|
83
86
|
const response = await this.client.messages.create({
|
|
84
|
-
model:
|
|
87
|
+
model: this.model,
|
|
85
88
|
max_tokens: 500,
|
|
86
89
|
temperature: 0,
|
|
87
90
|
messages: [
|