@a13xu/lucid 1.13.0 → 1.16.0
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/build/compression/semantic.d.ts +31 -0
- package/build/compression/semantic.js +196 -0
- package/build/config.d.ts +15 -0
- package/build/http/routes.d.ts +3 -0
- package/build/http/routes.js +56 -0
- package/build/http/server.d.ts +7 -0
- package/build/http/server.js +11 -0
- package/build/index.js +176 -0
- package/build/lucid-sync.d.ts +15 -0
- package/build/lucid-sync.js +72 -0
- package/build/retrieval/context.js +6 -0
- package/build/retrieval/qdrant.d.ts +1 -1
- package/build/retrieval/qdrant.js +11 -2
- package/build/tools/compress.d.ts +15 -0
- package/build/tools/compress.js +18 -0
- package/build/tools/init.js +16 -1
- package/build/tools/model-advisor.d.ts +9 -0
- package/build/tools/model-advisor.js +30 -0
- package/build/tools/smart-context.d.ts +16 -0
- package/build/tools/smart-context.js +54 -0
- package/build/tools/sync.js +8 -0
- package/package.json +64 -59
- package/skills/lucid-audit/SKILL.md +73 -53
- package/skills/lucid-context/SKILL.md +69 -35
- package/skills/lucid-plan/SKILL.md +52 -60
- package/skills/lucid-security/SKILL.md +41 -59
- package/skills/lucid-start/SKILL.md +70 -0
- package/skills/lucid-webdev/SKILL.md +45 -123
|
@@ -1,60 +1,52 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: lucid-plan
|
|
3
|
-
description:
|
|
4
|
-
argument-hint: "[feature or task description]"
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
###
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
| `blocked` | Waiting on external dependency |
|
|
54
|
-
|
|
55
|
-
## Tips
|
|
56
|
-
|
|
57
|
-
- Define `test_criteria` clearly — it becomes your acceptance test
|
|
58
|
-
- Use `plan_get` when resuming to quickly re-orient yourself
|
|
59
|
-
- Keep tasks small (1–4 hours each); use more tasks rather than fewer
|
|
60
|
-
- Notes are append-only — use them to document decisions made during implementation
|
|
1
|
+
---
|
|
2
|
+
name: lucid-plan
|
|
3
|
+
description: MANDATORY before writing code for any non-trivial feature — creates a persisted plan with tasks. HARD-GATE: no coding without a plan.
|
|
4
|
+
argument-hint: "[feature or task description]"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
<HARD-GATE>
|
|
8
|
+
You are about to write code for a feature or fix.
|
|
9
|
+
STOP. Create a plan first. Plans survive session restarts.
|
|
10
|
+
Do NOT write implementation code until a plan exists and tasks are defined.
|
|
11
|
+
</HARD-GATE>
|
|
12
|
+
|
|
13
|
+
## When to invoke
|
|
14
|
+
|
|
15
|
+
**INVOKE when:** implementing a feature, fixing a non-trivial bug, any task with 3+ steps
|
|
16
|
+
**DO NOT INVOKE for:** single-line fixes, config changes, documentation-only tasks
|
|
17
|
+
|
|
18
|
+
## Steps
|
|
19
|
+
|
|
20
|
+
### 0. Get model recommendation
|
|
21
|
+
```
|
|
22
|
+
suggest_model(task_description="<paste the user's task description>")
|
|
23
|
+
```
|
|
24
|
+
Say: **"Using [model] — [reasoning]"** then proceed.
|
|
25
|
+
|
|
26
|
+
### 1. Create the plan
|
|
27
|
+
```
|
|
28
|
+
plan_create(
|
|
29
|
+
title="<short descriptive title>",
|
|
30
|
+
description="<what this accomplishes>",
|
|
31
|
+
user_story="As a <user>, I want <goal>, so that <benefit>.",
|
|
32
|
+
tasks=[
|
|
33
|
+
{ title: "Task 1", description: "...", test_criteria: "How to verify it's done" },
|
|
34
|
+
{ title: "Task 2", description: "...", test_criteria: "..." },
|
|
35
|
+
]
|
|
36
|
+
)
|
|
37
|
+
```
|
|
38
|
+
Returns a `plan_id` and task IDs (format: `planId * 100 + sequence`).
|
|
39
|
+
|
|
40
|
+
### 2. Mark tasks in progress / done as you work
|
|
41
|
+
```
|
|
42
|
+
plan_update_task(task_id=101, status="in_progress")
|
|
43
|
+
plan_update_task(task_id=101, status="done", note="Decision made: used X instead of Y")
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### 3. Resume a session
|
|
47
|
+
```
|
|
48
|
+
plan_list() # all active plans
|
|
49
|
+
plan_get(plan_id=1) # full details + task status
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Task statuses: `pending` → `in_progress` → `done` | `blocked`
|
|
@@ -1,59 +1,41 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: lucid-security
|
|
3
|
-
description: Run
|
|
4
|
-
argument-hint: "[file path or
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
|
40
|
-
|
|
|
41
|
-
| 🔵
|
|
42
|
-
|
|
43
|
-
## Common patterns to watch
|
|
44
|
-
|
|
45
|
-
| Pattern | Risk |
|
|
46
|
-
|---|---|
|
|
47
|
-
| `element.innerHTML = userInput` | XSS — use `textContent` or DOMPurify |
|
|
48
|
-
| `eval(...)` / `new Function(...)` | Code injection |
|
|
49
|
-
| `const key = "sk-abc123..."` | Hardcoded secret — move to env var |
|
|
50
|
-
| `res.redirect(req.query.url)` | Open redirect — validate against allowlist |
|
|
51
|
-
| `readFile(req.params.filename)` | Path traversal — use `path.resolve` + bounds check |
|
|
52
|
-
| `Access-Control-Allow-Origin: *` | Overly permissive CORS |
|
|
53
|
-
|
|
54
|
-
## Note
|
|
55
|
-
|
|
56
|
-
Static scanning finds patterns, not all vulnerabilities. Complement with:
|
|
57
|
-
- Manual code review for business logic flaws
|
|
58
|
-
- DAST (dynamic testing) for runtime issues
|
|
59
|
-
- Dependency audit: `npm audit` / `pip-audit`
|
|
1
|
+
---
|
|
2
|
+
name: lucid-security
|
|
3
|
+
description: Run before merging any code that handles user input, auth, or external data — security scan + drift check for injection, XSS, and credential exposure.
|
|
4
|
+
argument-hint: "[file path or directory]"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
<HARD-GATE>
|
|
8
|
+
Before merging code that:
|
|
9
|
+
- Handles user input (forms, query params, file uploads)
|
|
10
|
+
- Implements auth, tokens, sessions, or permissions
|
|
11
|
+
- Calls external APIs or parses external data
|
|
12
|
+
- Manages files or runs shell commands
|
|
13
|
+
|
|
14
|
+
Run this skill. No exceptions.
|
|
15
|
+
</HARD-GATE>
|
|
16
|
+
|
|
17
|
+
## Steps
|
|
18
|
+
|
|
19
|
+
### 0. Get model recommendation
|
|
20
|
+
```
|
|
21
|
+
suggest_model(task_description="<paste the user's task description>")
|
|
22
|
+
```
|
|
23
|
+
Say: **"Using [model] — [reasoning]"** then proceed.
|
|
24
|
+
|
|
25
|
+
### 1. Security scan
|
|
26
|
+
```
|
|
27
|
+
security_scan(code="<file contents or snippet>", language="typescript", context="backend")
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### 2. Drift check for security-sensitive snippets
|
|
31
|
+
```
|
|
32
|
+
check_drift(code="<auth/input-handling code>", language="typescript")
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### 3. Fix all CRITICAL issues before merging
|
|
36
|
+
|
|
37
|
+
| Severity | Action |
|
|
38
|
+
|---|---|
|
|
39
|
+
| 🔴 CRITICAL | Block merge — fix immediately |
|
|
40
|
+
| 🟠 HIGH | Fix before merge |
|
|
41
|
+
| 🔵 MEDIUM/LOW | Track, fix in follow-up |
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: lucid-start
|
|
3
|
+
description: MANDATORY at every session start and before any coding task — loads project context via Lucid before Claude reads any file or writes any code
|
|
4
|
+
argument-hint: "[optional: what you are about to work on]"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
<HARD-GATE>
|
|
8
|
+
You MUST complete ALL steps below BEFORE:
|
|
9
|
+
- Reading any source file
|
|
10
|
+
- Writing or editing any code
|
|
11
|
+
- Answering any coding question
|
|
12
|
+
- Creating any plan or task
|
|
13
|
+
|
|
14
|
+
This is not optional. There are no exceptions. "I'll do it after" is not acceptable.
|
|
15
|
+
</HARD-GATE>
|
|
16
|
+
|
|
17
|
+
## Steps (all mandatory, in order)
|
|
18
|
+
|
|
19
|
+
### 0. Get model recommendation
|
|
20
|
+
```
|
|
21
|
+
suggest_model(task_description="<paste the user's task description>")
|
|
22
|
+
```
|
|
23
|
+
Say: **"Using [model] — [reasoning]"** then proceed.
|
|
24
|
+
|
|
25
|
+
### 1. Check what changed recently
|
|
26
|
+
```
|
|
27
|
+
get_recent(hours=48)
|
|
28
|
+
```
|
|
29
|
+
This shows files modified since your last session. Review the list.
|
|
30
|
+
|
|
31
|
+
### 2. If working on a specific task — load relevant context
|
|
32
|
+
```
|
|
33
|
+
smart_context(query="<describe what you are about to work on>", task_type="moderate")
|
|
34
|
+
```
|
|
35
|
+
If the user's request involves code, call smart_context. For purely conversational exchanges with zero code involvement, this step may be omitted.
|
|
36
|
+
|
|
37
|
+
### 3. Announce readiness
|
|
38
|
+
Say: "✓ Lucid active — context loaded"
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## After EVERY file write or edit
|
|
43
|
+
|
|
44
|
+
Call `sync_file` IMMEDIATELY after the tool call completes:
|
|
45
|
+
```
|
|
46
|
+
sync_file(path="<exact path of file you just wrote or edited>")
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
**Do this before anything else.** Before the next file. Before the next thought. Now.
|
|
50
|
+
|
|
51
|
+
If you modified multiple files (refactor, git pull): call `sync_project()` instead.
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## Before marking any task as done
|
|
56
|
+
|
|
57
|
+
Run /lucid-audit before saying "done", "fixed", "complete", or "implemented".
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## Trigger conditions
|
|
62
|
+
|
|
63
|
+
**USE this skill:**
|
|
64
|
+
- At the start of every new conversation
|
|
65
|
+
- When resuming work after a break
|
|
66
|
+
- When the user says "let's work on X" or similar
|
|
67
|
+
|
|
68
|
+
**DO NOT USE for:**
|
|
69
|
+
- Pure conversation with no code involved
|
|
70
|
+
- Answering theoretical questions
|
|
@@ -1,123 +1,45 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: lucid-webdev
|
|
3
|
-
description:
|
|
4
|
-
argument-hint: "[
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
)
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
)
|
|
45
|
-
|
|
46
|
-
Returns: HTML meta tags + Open Graph + Twitter Card + JSON-LD structured data.
|
|
47
|
-
|
|
48
|
-
### Audit accessibility (WCAG)
|
|
49
|
-
```
|
|
50
|
-
accessibility_audit(
|
|
51
|
-
code="<your HTML/JSX/Vue snippet>",
|
|
52
|
-
wcag_level="AA", # A | AA | AAA
|
|
53
|
-
framework="vue" # html | jsx | vue
|
|
54
|
-
)
|
|
55
|
-
```
|
|
56
|
-
Returns: violations with severity (critical/warning/info), WCAG criterion, and corrected code.
|
|
57
|
-
|
|
58
|
-
## API & Testing
|
|
59
|
-
|
|
60
|
-
### Generate a typed API client
|
|
61
|
-
```
|
|
62
|
-
api_client(
|
|
63
|
-
endpoint="/users/:id",
|
|
64
|
-
method="GET", # GET | POST | PUT | PATCH | DELETE
|
|
65
|
-
response_schema="{ id: string; name: string; email: string }",
|
|
66
|
-
auth="bearer", # bearer | cookie | apikey | none
|
|
67
|
-
base_url_var="NEXT_PUBLIC_API_URL"
|
|
68
|
-
)
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
### Generate tests
|
|
72
|
-
```
|
|
73
|
-
test_generator(
|
|
74
|
-
code="<your function or component source>",
|
|
75
|
-
test_framework="vitest", # vitest | jest | playwright
|
|
76
|
-
test_type="unit", # unit | integration | e2e
|
|
77
|
-
component_framework="vue" # vue | react | none
|
|
78
|
-
)
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
## Layout & Design
|
|
82
|
-
|
|
83
|
-
### Generate a responsive layout
|
|
84
|
-
```
|
|
85
|
-
responsive_layout(
|
|
86
|
-
description="sidebar left 260px, main content, right panel 240px",
|
|
87
|
-
framework="tailwind", # tailwind | css-grid | flexbox
|
|
88
|
-
breakpoints=["mobile", "tablet", "desktop"],
|
|
89
|
-
container="sidebar" # full | centered | sidebar
|
|
90
|
-
)
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
### Generate design tokens
|
|
94
|
-
```
|
|
95
|
-
design_tokens(
|
|
96
|
-
brand_name="Acme",
|
|
97
|
-
primary_color="#6366F1", # hex or name (blue, green, etc.)
|
|
98
|
-
mood="minimal", # minimal | bold | playful | corporate
|
|
99
|
-
output_format="css-variables" # css-variables | tailwind-config | json
|
|
100
|
-
)
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
## Security & Performance
|
|
104
|
-
|
|
105
|
-
### Scan for security vulnerabilities
|
|
106
|
-
```
|
|
107
|
-
security_scan(
|
|
108
|
-
code="<your code snippet>",
|
|
109
|
-
language="typescript", # javascript | typescript | html | vue
|
|
110
|
-
context="frontend" # frontend | backend | api
|
|
111
|
-
)
|
|
112
|
-
```
|
|
113
|
-
Detects: XSS, eval/injection, hardcoded secrets, SQL injection, open redirects, CORS issues.
|
|
114
|
-
|
|
115
|
-
### Analyze Core Web Vitals issues
|
|
116
|
-
```
|
|
117
|
-
perf_hints(
|
|
118
|
-
code="<your component or page source>",
|
|
119
|
-
framework="vue", # react | vue | nuxt | vanilla
|
|
120
|
-
context="page" # component | page | layout
|
|
121
|
-
)
|
|
122
|
-
```
|
|
123
|
-
Detects: missing image dimensions (CLS), render-blocking scripts (FCP), fetch-in-render (TTFB), heavy click handlers (INP), missing useMemo/computed.
|
|
1
|
+
---
|
|
2
|
+
name: lucid-webdev
|
|
3
|
+
description: Use for web development tasks — generates components, pages, audits, API clients, and performance hints via Lucid's 10 web dev tools.
|
|
4
|
+
argument-hint: "[what you are building: component/page/api/audit]"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
<HARD-GATE>
|
|
8
|
+
Before building any web component, page, or API client from scratch:
|
|
9
|
+
call the relevant generator tool first. Do not write boilerplate manually.
|
|
10
|
+
</HARD-GATE>
|
|
11
|
+
|
|
12
|
+
## When to invoke
|
|
13
|
+
|
|
14
|
+
**INVOKE when:** building UI components, scaffolding pages, writing API clients, running accessibility/security/performance audits
|
|
15
|
+
**DO NOT INVOKE for:** backend-only logic with no web layer
|
|
16
|
+
|
|
17
|
+
## Steps
|
|
18
|
+
|
|
19
|
+
### 0. Get model recommendation
|
|
20
|
+
```
|
|
21
|
+
suggest_model(task_description="<paste the user's task description>")
|
|
22
|
+
```
|
|
23
|
+
Say: **"Using [model] — [reasoning]"** then proceed.
|
|
24
|
+
|
|
25
|
+
## Available tools
|
|
26
|
+
|
|
27
|
+
| Task | Tool |
|
|
28
|
+
|---|---|
|
|
29
|
+
| Generate a React/Vue component | `generate_component(description, framework, styling, typescript)` |
|
|
30
|
+
| Scaffold a full page | `scaffold_page(page_name, framework, sections, seo_title)` |
|
|
31
|
+
| SEO meta tags | `seo_meta(title, description, keywords, page_type, url, image_url)` |
|
|
32
|
+
| Accessibility audit | `accessibility_audit(code, wcag_level, framework)` |
|
|
33
|
+
| API client | `api_client(endpoint, method, response_schema, auth, base_url_var)` |
|
|
34
|
+
| Test scaffolding | `test_generator(code, test_framework, test_type, component_framework)` |
|
|
35
|
+
| Responsive layout | `responsive_layout(description, framework, breakpoints, container)` |
|
|
36
|
+
| Security scan | `security_scan(code, language, context)` |
|
|
37
|
+
| Design tokens | `design_tokens(brand_name, primary_color, mood, output_format)` |
|
|
38
|
+
| Performance hints | `perf_hints(code, framework, context)` |
|
|
39
|
+
|
|
40
|
+
## Workflow
|
|
41
|
+
|
|
42
|
+
1. Call the relevant generator/auditor tool
|
|
43
|
+
2. Review output → adapt to project conventions
|
|
44
|
+
3. `sync_file(path="<generated file>")` after saving
|
|
45
|
+
4. Run /lucid-audit before marking done
|