init
This commit is contained in:
commit
fe636432d0
154 files changed
+30381
No files matched your search
@@ -0,0 +1,61 @@
|
||||
# Dify Diff And Group UX Plan
|
||||
> **For agent:** Execute directly against the existing implementation. Keep the current server deployment and avoid rebuilding core business logic.
|
||||
|
||||
**Goal:** Make the group area operationally clean, add a concrete Dify-vs-local diff surface for selected groups, prevent accidental duplicate pushes, and resolve the current stuck sync pair on the server.
|
||||
|
||||
**Architecture:** Keep the current FastAPI + worker + Vue SPA + Docker Compose structure. Add a lightweight comparison endpoint and a focused workspace UI refinement without introducing new dependencies.
|
||||
|
||||
## Current Findings
|
||||
|
||||
- The current sync failure is not caused by missing embedding or rerank model settings.
|
||||
- The latest failed job timed out while waiting for Dify indexing, and the remote document remained stuck in `indexing`.
|
||||
- Group cards still expose oversized management controls and the workspace does not yet provide a direct “show me local vs Dify differences” view.
|
||||
- Current wording around Dify actions still risks reading like bidirectional sync when the implemented behavior is local push plus remote mapping.
|
||||
|
||||
## Execution Tracks
|
||||
|
||||
### Track 1: Group UX refinement
|
||||
**Files:**
|
||||
- Modify: `frontend/src/views/WorkspaceView.vue`
|
||||
- Modify: `frontend/src/style.css`
|
||||
- Modify: `frontend/src/lib/i18n.ts`
|
||||
|
||||
**Steps:**
|
||||
1. Replace large group edit/delete buttons with compact icon actions on the group card.
|
||||
2. Keep inline create only for the empty-state path.
|
||||
3. Move group management to card-level actions only and keep the selected-group summary informational.
|
||||
4. Tighten copy so Dify actions read as push/status, not realtime bidirectional sync.
|
||||
|
||||
### Track 2: Dify diff surface
|
||||
**Files:**
|
||||
- Modify: `backend/app/services/dify_service.py`
|
||||
- Modify: `backend/app/api/groups.py`
|
||||
- Modify: `frontend/src/views/WorkspaceView.vue`
|
||||
- Modify: `frontend/src/lib/i18n.ts`
|
||||
- Modify tests under `backend/tests/`
|
||||
|
||||
**Steps:**
|
||||
1. List remote Dify documents for the selected dataset.
|
||||
2. Compare local documents and remote documents by normalized document name within the selected group.
|
||||
3. Return summary buckets and row-level status so the UI can show matched, local-only, Dify-only, and attention items.
|
||||
4. Add a modal viewer in the workspace with search by file name inside the selected group.
|
||||
|
||||
### Track 3: Duplicate push guard and dirty data cleanup
|
||||
**Files:**
|
||||
- Modify: `backend/app/api/files.py`
|
||||
- Apply one-off server cleanup for the current stuck local/remote record pair
|
||||
|
||||
**Steps:**
|
||||
1. Reject single-document pushes when the current version is already marked `synced`.
|
||||
2. Skip already-synced rows during batch push.
|
||||
3. Delete the currently stuck remote Dify document and clear the corresponding local failed sync state so the next push starts from a clean baseline.
|
||||
4. Rebuild only affected services and run a real server verification pass.
|
||||
|
||||
## Verification
|
||||
|
||||
1. Run targeted backend tests for diff and push guard behavior.
|
||||
2. Run frontend `npm run build`.
|
||||
3. Deploy updated backend and frontend services to `192.168.100.230`.
|
||||
4. Verify group actions are compact and usable in the browser.
|
||||
5. Verify the Dify diff modal reflects matched, local-only, Dify-only, and attention states.
|
||||
6. Re-run a real Dify push after cleanup and confirm it reaches a completed indexing state.
|
||||
@@ -0,0 +1,82 @@
|
||||
# Local And Server Integration Plan
|
||||
> **For agent:** REQUIRED SUB-SKILL: Use Section 4 or Section 5 to implement this plan.
|
||||
**Goal:** Prepare `D:\Document Cleaning` for local and server integration, then execute real smoke tests for upload, conversion, download, deletion, and Dify sync where credentials allow.
|
||||
**Architecture:** Keep the existing Docker deployment path for server use, but add a direct local execution path that does not depend on Docker, Redis, or PostgreSQL being installed on the developer workstation. Real conversion should run through the existing `edkb_system` and LibreOffice chain. Dify sync should use the existing production service when a real API key is present.
|
||||
**Tech Stack:** FastAPI, SQLAlchemy, Alembic, RQ, Redis, PostgreSQL, SQLite, Vue/Vite, LibreOffice
|
||||
|
||||
## Current Environment Findings
|
||||
|
||||
- `docker` and `docker compose` are not installed or not on PATH in the current Windows environment.
|
||||
- LibreOffice is installed locally at `C:\Program Files\LibreOffice\program\soffice.exe`.
|
||||
- Python and Node are installed locally.
|
||||
- Root `.env` is missing.
|
||||
- `DIFY_API_KEY` is currently empty in `.env.example`, `backend.env.example`, and the current process/user/machine environment.
|
||||
|
||||
## Execution Strategy
|
||||
|
||||
### Track 1: Server Path
|
||||
**Files:**
|
||||
- Modify as needed: `docker-compose.yml`
|
||||
- Modify as needed: `.env.example`
|
||||
- Modify as needed: `backend/backend.env.example`
|
||||
**Steps:**
|
||||
1. Normalize environment variable handling so `PUBLIC_BASE_URL` and the Dify settings are driven by `.env`.
|
||||
2. Create a real root `.env` file for the current machine.
|
||||
3. Verify the compose configuration is ready for the target server once Docker is available.
|
||||
|
||||
### Track 2: Local Path
|
||||
**Files:**
|
||||
- Modify as needed: `backend/app/config.py`
|
||||
- Modify as needed: `backend/app/services/queue_service.py`
|
||||
- Modify as needed: `backend/worker.py`
|
||||
- Modify as needed: `.env.example`
|
||||
- Modify as needed: `backend/backend.env.example`
|
||||
**Steps:**
|
||||
1. Add a local task execution mode that can run queue tasks inline without Redis.
|
||||
2. Keep the existing RQ mode unchanged for server deployment.
|
||||
3. Configure the current workstation to use SQLite plus inline execution for local smoke tests.
|
||||
|
||||
### Task 1: Prepare integration configuration
|
||||
**Files:**
|
||||
- Modify: `docker-compose.yml`
|
||||
- Modify: `.env.example`
|
||||
- Modify: `backend/backend.env.example`
|
||||
- Create: `.env`
|
||||
**Step 1:** Add all required variables for local and server paths, including `PUBLIC_BASE_URL` and a task execution mode switch.
|
||||
**Step 2:** Keep production defaults intact where possible.
|
||||
**Step 3:** Verify the resulting configuration files are internally consistent.
|
||||
|
||||
### Task 2: Add local inline task execution mode
|
||||
**Files:**
|
||||
- Modify: `backend/app/config.py`
|
||||
- Modify: `backend/app/services/queue_service.py`
|
||||
- Modify as needed: `backend/tests/*`
|
||||
**Step 1:** Add a configuration switch that chooses between `rq` and `sync`.
|
||||
**Step 2:** In `sync` mode, execute `app.tasks.run_convert_job` and `app.tasks.run_sync_job` inline while preserving persisted job state.
|
||||
**Step 3:** Verify the existing backend tests still pass after the change.
|
||||
|
||||
### Task 3: Start the local integration stack
|
||||
**Files:**
|
||||
- Read: `frontend/vite.config.ts`
|
||||
- Read: `backend/alembic.ini`
|
||||
- Read: `backend/migrations/env.py`
|
||||
**Step 1:** Run Alembic against the local database.
|
||||
**Step 2:** Start the backend locally.
|
||||
**Step 3:** Start the frontend locally if needed for manual browser access.
|
||||
**Step 4:** Confirm health and login endpoints respond over HTTP.
|
||||
|
||||
### Task 4: Run real smoke tests
|
||||
**Files:**
|
||||
- Read: `backend/data/original/**/*`
|
||||
- Use runtime data under `backend/data/`
|
||||
**Step 1:** Create a real group and upload a real document through the running API.
|
||||
**Step 2:** Verify conversion completes using the existing document cleaning pipeline and LibreOffice path.
|
||||
**Step 3:** Verify original download, markdown download, and local delete.
|
||||
**Step 4:** Attempt real Dify sync if a valid key is available; otherwise capture the exact blocker and the furthest successful precondition.
|
||||
|
||||
### Task 5: Report integration status
|
||||
**Files:**
|
||||
- Read: generated runtime output and logs
|
||||
**Step 1:** Record what was prepared for server deployment.
|
||||
**Step 2:** Record what was proven locally with real runtime execution.
|
||||
**Step 3:** Record any remaining blockers, especially around Docker and Dify credentials.
|
||||
@@ -0,0 +1,69 @@
|
||||
# Product UI And Deploy Hygiene Plan
|
||||
> **For agent:** Execute directly against the existing implementation. Do not rebuild the stack from scratch.
|
||||
|
||||
**Goal:** Lift the current document cleaning system from an internal-tool baseline to a more professional product interface, tighten the local-to-server deployment workflow, and make Dify dataset model selection automatic instead of relying on manual console completion.
|
||||
|
||||
**Architecture:** Keep the current FastAPI + worker + Vue SPA + Docker Compose structure. Improve only the frontend experience, Dify integration defaults, and deployment packaging boundaries.
|
||||
|
||||
## Current Findings
|
||||
|
||||
- The core business flow is already usable end to end on the server.
|
||||
- The frontend still reads as an engineering utility rather than a finished product surface.
|
||||
- Server deployments were previously syncing non-runtime content such as `project-governance` and test artifacts.
|
||||
- Dify dataset creation succeeded, but embedding and rerank model assignment was not being written by the API layer.
|
||||
|
||||
## Execution Tracks
|
||||
|
||||
### Track 1: Productize the frontend
|
||||
**Files:**
|
||||
- Modify: `frontend/src/style.css`
|
||||
- Modify: `frontend/src/App.vue`
|
||||
- Modify: `frontend/src/views/LoginView.vue`
|
||||
- Modify: `frontend/src/views/WorkspaceView.vue`
|
||||
- Modify: `frontend/src/views/AdminView.vue`
|
||||
- Modify as needed: `frontend/src/components/*`
|
||||
- Modify as needed: `frontend/src/lib/i18n.ts`
|
||||
|
||||
**Steps:**
|
||||
1. Introduce a clearer visual direction with stronger surfaces, hierarchy, spacing, and global polish.
|
||||
2. Keep the existing route structure and API contract intact.
|
||||
3. Add bilingual UI support and a global language switch without introducing new dependencies.
|
||||
4. Improve the admin configuration experience so Dify defaults feel like product settings, not raw system fields.
|
||||
|
||||
### Track 2: Automate Dify model selection
|
||||
**Files:**
|
||||
- Modify: `backend/app/services/dify_service.py`
|
||||
- Modify: `backend/app/tasks.py`
|
||||
- Modify: `backend/app/models.py`
|
||||
- Modify: `backend/app/schemas.py`
|
||||
- Modify: `backend/app/serializers.py`
|
||||
- Modify: `backend/app/api/admin.py`
|
||||
- Modify: `backend/app/services/bootstrap_service.py`
|
||||
- Modify: `backend/app/config.py`
|
||||
- Create: `backend/migrations/versions/20260328_0002_dify_model_defaults.py`
|
||||
- Modify tests under `backend/tests/`
|
||||
|
||||
**Steps:**
|
||||
1. Query the live Dify model catalog for embedding and rerank providers/models.
|
||||
2. Apply a deterministic automatic choice when admin settings leave model fields empty.
|
||||
3. Expose available models and automatic defaults in the admin API.
|
||||
4. Allow explicit override from the admin UI while keeping automatic selection as the default path.
|
||||
|
||||
### Track 3: Tighten deployment boundaries
|
||||
**Files:**
|
||||
- Modify as needed: deployment packaging commands/scripts
|
||||
- Keep on server only runtime files and secrets
|
||||
|
||||
**Steps:**
|
||||
1. Exclude governance docs, tests, caches, local databases, and built artifacts from server syncs.
|
||||
2. Remove already-synced non-runtime directories from the server deployment tree.
|
||||
3. Rebuild only affected services after frontend/backend changes.
|
||||
|
||||
## Verification
|
||||
|
||||
1. Run targeted backend tests for admin settings and Dify task flows.
|
||||
2. Run full backend `pytest` once the backend changes settle.
|
||||
3. Run frontend `npm run build`.
|
||||
4. Rebuild the changed Docker services on the server.
|
||||
5. Execute a real server smoke test for login, upload, conversion, markdown download, Dify sync, and delete with `delete_dify=true`.
|
||||
6. Confirm through the Dify API that new datasets carry embedding/rerank model settings and that remote documents return `404` after delete.
|
||||
@@ -0,0 +1,91 @@
|
||||
# Stability Hardening Implementation Plan
|
||||
> **For agent:** REQUIRED SUB-SKILL: Use Section 4 or Section 5 to implement this plan.
|
||||
**Goal:** Strengthen the existing document cleaning system without redesign by expanding backend coverage for critical workflows and removing known deprecations.
|
||||
**Architecture:** Keep the current FastAPI + SQLAlchemy + RQ structure intact. Add focused backend tests around task execution and admin APIs, then make the smallest production changes needed to satisfy those tests and remove framework/runtime deprecation warnings.
|
||||
**Tech Stack:** FastAPI, SQLAlchemy, pytest, Vue/Vite build verification, SQLite test database
|
||||
|
||||
## Constraints
|
||||
|
||||
- Continue from the current implementation. Do not rebuild flows or replace the current architecture.
|
||||
- Save governance artifacts under `project-governance/`.
|
||||
- Run targeted verification after each completed block, then run the full backend suite and frontend build at the end.
|
||||
- Frontend code is out of scope unless backend changes force a UI adjustment.
|
||||
|
||||
### Task 1: Establish plan and baseline
|
||||
**Files:**
|
||||
- Create: `project-governance/plans/2026-03-28-stability-hardening-plan.md`
|
||||
- Read: `backend/tests/conftest.py`
|
||||
- Read: `backend/app/tasks.py`
|
||||
- Read: `backend/app/main.py`
|
||||
- Read: `backend/app/models.py`
|
||||
**Step 1:** Record the implementation plan in this file.
|
||||
**Step 2:** Confirm the current backend and frontend verification commands still pass:
|
||||
- `cd backend && python -m pytest tests -q`
|
||||
- `cd frontend && npm run build`
|
||||
**Step 3:** Use the baseline output as the comparison point for later changes.
|
||||
|
||||
### Task 2: Add conversion and Dify task coverage
|
||||
**Files:**
|
||||
- Modify: `backend/tests/conftest.py`
|
||||
- Create or modify: `backend/tests/test_tasks.py`
|
||||
- Modify as needed: `backend/app/tasks.py`
|
||||
**Step 1:** Write failing tests covering:
|
||||
- conversion task success path
|
||||
- conversion task failure path
|
||||
- Dify sync success path
|
||||
- Dify sync failure path
|
||||
**Step 2:** Run only the new task-focused tests and confirm they fail for the expected reasons.
|
||||
**Step 3:** Implement the smallest production changes needed to make those tests pass.
|
||||
**Step 4:** Re-run the task-focused tests and confirm they pass cleanly.
|
||||
|
||||
### Task 3: Add delete flow coverage
|
||||
**Files:**
|
||||
- Modify: `backend/tests/test_uploads.py` or create `backend/tests/test_files_api.py`
|
||||
- Modify as needed: `backend/app/api/files.py`
|
||||
**Step 1:** Write failing tests for:
|
||||
- delete local document only
|
||||
- delete local document and remote Dify document
|
||||
**Step 2:** Run the delete-focused tests and confirm they fail for the expected reasons.
|
||||
**Step 3:** Apply the minimum production changes required.
|
||||
**Step 4:** Re-run the delete-focused tests and confirm they pass.
|
||||
|
||||
### Task 4: Add admin API coverage
|
||||
**Files:**
|
||||
- Create: `backend/tests/test_admin_api.py`
|
||||
- Modify as needed: `backend/app/api/admin.py`
|
||||
- Modify as needed: `backend/app/api/jobs.py`
|
||||
- Modify as needed: `backend/app/api/auth.py`
|
||||
**Step 1:** Write failing tests for the core management endpoints:
|
||||
- create user
|
||||
- update user
|
||||
- fetch settings
|
||||
- update settings
|
||||
- list jobs
|
||||
- enforce admin protection on admin endpoints
|
||||
**Step 2:** Run the admin-focused tests and confirm they fail for the expected reasons.
|
||||
**Step 3:** Make the smallest production changes required.
|
||||
**Step 4:** Re-run the admin-focused tests and confirm they pass.
|
||||
|
||||
### Task 5: Remove known deprecations
|
||||
**Files:**
|
||||
- Modify: `backend/app/main.py`
|
||||
- Modify: `backend/app/models.py`
|
||||
- Modify: `backend/app/tasks.py`
|
||||
- Modify as needed: `backend/tests/conftest.py`
|
||||
**Step 1:** Replace FastAPI startup `on_event` usage with a `lifespan` handler.
|
||||
**Step 2:** Replace `datetime.utcnow()` defaults and timestamps with timezone-aware UTC helpers.
|
||||
**Step 3:** Run the backend suite and check that the previously observed deprecation warnings are removed.
|
||||
**Step 4:** If warnings remain, trace the exact source and make the smallest additional fix.
|
||||
|
||||
### Task 6: Final verification
|
||||
**Files:**
|
||||
- Read: `backend/tests/*.py`
|
||||
- Read: `frontend/package.json`
|
||||
**Step 1:** Run the full backend suite:
|
||||
- `cd backend && python -m pytest tests -q`
|
||||
**Step 2:** Run the frontend build:
|
||||
- `cd frontend && npm run build`
|
||||
**Step 3:** Summarize:
|
||||
- changed behavior
|
||||
- test evidence
|
||||
- remaining risks or uncovered areas
|
||||
@@ -0,0 +1,19 @@
|
||||
# Workspace Productization Round 2 Plan
|
||||
> **For agent:** REQUIRED SUB-SKILL: Use Section 4 or Section 5 to implement this plan.
|
||||
**Goal:** Tighten the knowledge-base workspace into a compact product-grade operations UI without changing the backend data model.
|
||||
**Architecture:** Keep the current Vue SPA and FastAPI APIs, but restructure the workspace around three layers: knowledge-base navigation, global system overview, and current knowledge-base actions. Support features such as global Dify diff, modal uploads, and online preview through existing APIs, adding only lightweight summary/diff endpoints where needed.
|
||||
**Tech Stack:** Vue 3, TypeScript, Tailwind CSS, Uppy, FastAPI, SQLAlchemy, Dify API
|
||||
|
||||
## Scope
|
||||
- Replace the sidebar “detail cards” with compact knowledge-base navigation items.
|
||||
- Add global summary metrics and a global Dify diff entry point.
|
||||
- Move batch upload into a modal and separate file vs folder selection.
|
||||
- Simplify filters and document actions.
|
||||
- Add online preview for source/Markdown where browser support allows.
|
||||
- Keep all user-facing terminology as “知识库 / Knowledge Base”.
|
||||
|
||||
## Verification
|
||||
- `cd backend && python -m pytest tests/test_uploads.py tests/test_files_api.py -q`
|
||||
- `cd frontend && npm run build`
|
||||
- Deploy updated `backend` and `frontend` to `192.168.100.230`
|
||||
- Verify homepage, login, knowledge-base list, global diff, upload modal, preview actions, and delete flows on server
|
||||
@@ -0,0 +1,39 @@
|
||||
# Access Control And Admin UI Implementation Plan
|
||||
> **For agent:** REQUIRED SUB-SKILL: Use Section 4 or Section 5 to implement this plan.
|
||||
**Goal:** Add three-tier roles plus knowledge-base access control, and simplify workspace/admin UI around Dify settings and diff management.
|
||||
**Architecture:** Backend introduces a user-to-knowledge-base access table and expands role handling from two levels to three. Frontend aligns workspace and admin around a shared account/settings pattern, removes noisy admin panels, and tightens diff/search/delete flows.
|
||||
**Tech Stack:** FastAPI, SQLAlchemy, Alembic, Vue 3, TypeScript, Tailwind CSS
|
||||
|
||||
## Tasks
|
||||
|
||||
### Task 1: Role and access schema
|
||||
- Add `super_admin` role handling.
|
||||
- Add `user_group_access` table and ORM relationships.
|
||||
- Update bootstrap defaults so the seeded admin becomes `super_admin`.
|
||||
- Add Alembic migration.
|
||||
|
||||
### Task 2: API authorization
|
||||
- Restrict knowledge-base and file access by role + assigned knowledge bases.
|
||||
- Keep `super_admin` global.
|
||||
- Allow `admin` to access operational admin pages, but require `super_admin` for user management.
|
||||
- Support storing `accessible_group_ids` on user create/update.
|
||||
|
||||
### Task 3: Workspace header and settings
|
||||
- Move Dify settings into the account menu.
|
||||
- Reuse the same account-menu pattern in workspace and admin.
|
||||
- Keep admin console entry only for admin tiers.
|
||||
|
||||
### Task 4: Diff and delete dialogs
|
||||
- Global diff search uses explicit search type (`knowledge_base` / `file_name`) with matching placeholder.
|
||||
- Diff table uses fixed-width layout and stable footer.
|
||||
- Knowledge-base delete dialog uses top-right `X` and simplified body.
|
||||
|
||||
### Task 5: Admin page simplification
|
||||
- Remove knowledge-base management and recent jobs panels.
|
||||
- Keep Dify health and user management.
|
||||
- Add per-user knowledge-base access controls and three role options.
|
||||
|
||||
### Task 6: Verification and deployment
|
||||
- Run backend pytest coverage for admin/files/groups access behavior.
|
||||
- Run frontend build.
|
||||
- Apply migration on server and rebuild `api`/`frontend`.
|
||||
@@ -0,0 +1,51 @@
|
||||
# Department Permission And Admin Refactor Plan
|
||||
|
||||
> For this round, continue based on the existing implementation and do not rebuild from scratch.
|
||||
|
||||
## Goal
|
||||
|
||||
Refactor the admin and permission model so that:
|
||||
|
||||
- the `admin` account is the only `super_admin`
|
||||
- permissions are centered on departments instead of direct user-to-knowledge-base bindings
|
||||
- knowledge bases belong to departments
|
||||
- workspace visibility is filtered by department
|
||||
- the admin page becomes a focused permission management console
|
||||
- Dify health moves into a user-menu dialog
|
||||
|
||||
## Scope
|
||||
|
||||
### Backend
|
||||
|
||||
- Add `Department` and `UserDepartmentAccess` models
|
||||
- Add `primary_department_id` to `users`
|
||||
- Add `department_id` to `groups`
|
||||
- Backfill existing users and knowledge bases into a default department
|
||||
- Enforce `admin` as the only `super_admin`
|
||||
- Replace group visibility calculation from `UserGroupAccess` to department-based access
|
||||
- Add department CRUD and user permission management endpoints
|
||||
|
||||
### Frontend
|
||||
|
||||
- Replace admin page with permission management
|
||||
- Move Dify health to a modal entry under the user menu
|
||||
- Rename user menu setting entry to `Dify设置`
|
||||
- Change inline user editing to dialog-driven create/edit flows
|
||||
- Add department selector to workspace sidebar and group creation flow
|
||||
- Keep UI feedback lightweight with toast-style transient notices
|
||||
|
||||
### Validation
|
||||
|
||||
- Update backend tests for new department-based access model
|
||||
- Run full backend pytest
|
||||
- Run frontend build
|
||||
- Deploy `api + worker + frontend`
|
||||
- Verify role enforcement, department visibility, and Dify dialogs on server
|
||||
|
||||
## Implementation Order
|
||||
|
||||
1. Introduce department data model and migration with safe backfill.
|
||||
2. Update permission helpers, group/file APIs, and admin APIs to use departments.
|
||||
3. Rebuild the admin page into permission management and move Dify health into a dialog.
|
||||
4. Update workspace department filter and knowledge-base ownership UX.
|
||||
5. Run full validation and deploy.
|
||||
@@ -0,0 +1,24 @@
|
||||
# Dify Self-Healing Implementation Plan
|
||||
> **For agent:** REQUIRED SUB-SKILL: Use Section 4 or Section 5 to implement this plan.
|
||||
**Goal:** Add automatic Dify sync self-healing so stuck syncs recover cleanly, admins can see Dify health, and the server can restart Dify worker when queue execution stalls.
|
||||
**Architecture:** The backend gains a watchdog service layer for stale-sync recovery and health snapshot reading, plus admin APIs for inspection and manual recovery. A host-level watchdog script on the deployment server inspects Dify queues/tasks via Docker, persists a JSON health snapshot into the app data volume, and restarts `dify-worker` when stuck-task thresholds are exceeded.
|
||||
**Tech Stack:** FastAPI, SQLAlchemy, Vue 3, Docker Compose, Redis, PostgreSQL, host-side Python watchdog script.
|
||||
|
||||
## Scope
|
||||
- Backend stale sync recovery logic
|
||||
- Admin health/status APIs
|
||||
- Host watchdog script and server cron installation
|
||||
- Admin console Dify health panel
|
||||
- Real server verification
|
||||
|
||||
## Non-Goals
|
||||
- Replacing Dify’s own queue implementation
|
||||
- Automatic blind resync loops for failed documents
|
||||
- Adding Docker socket access into the app containers
|
||||
|
||||
## Task Outline
|
||||
1. Add watchdog-oriented backend services for stale-sync recovery and persisted health snapshot access.
|
||||
2. Add admin API endpoints for Dify health visibility and manual stale-sync cleanup.
|
||||
3. Add host watchdog script and deployment wiring on `192.168.100.230`.
|
||||
4. Extend admin UI with a compact Dify health panel.
|
||||
5. Verify locally, deploy to server, run real Dify health and sync smoke checks.
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
# Permission Console And Department Workflow Plan
|
||||
|
||||
> Continue from the existing implementation. Do not rebuild the system from scratch.
|
||||
|
||||
## Goal
|
||||
|
||||
Make the admin experience coherent around department-based permissions, keep `admin` as the only super admin, and move Dify operational controls into the user menu while keeping workspace behavior department-aware.
|
||||
|
||||
## Outcomes
|
||||
|
||||
- `admin` remains the only `super_admin`
|
||||
- users are managed through modal create/edit flows
|
||||
- departments become the primary access boundary for knowledge bases
|
||||
- workspace exposes a department selector on the left and respects that scope
|
||||
- Dify settings and Dify health move under the username menu
|
||||
- stale-sync recovery uses toast feedback only
|
||||
|
||||
## Backend
|
||||
|
||||
1. Re-verify the unique-super-admin policy around `admin`
|
||||
2. Keep department-based visibility and department ownership on knowledge bases
|
||||
3. Ensure user payloads expose:
|
||||
- `primary_department_id`
|
||||
- `primary_department_name`
|
||||
- `accessible_department_ids`
|
||||
- `extra_department_ids`
|
||||
4. Keep Dify health and stale recovery endpoints, but align wording with “stuck sync” semantics
|
||||
|
||||
## Frontend
|
||||
|
||||
1. Workspace
|
||||
- show department switcher in the left sidebar
|
||||
- keep knowledge-base create/edit department ownership in dialogs
|
||||
- expose `Dify设置` and `Dify健康状态` from the username menu
|
||||
2. Admin
|
||||
- use the page as `权限管理`
|
||||
- left side: department management
|
||||
- right side: users and department access
|
||||
- create/edit users via modal only
|
||||
- remove obsolete knowledge-base-management and recent-jobs sections
|
||||
3. Dify Health
|
||||
- render as dialog from the username menu
|
||||
- replace banner-style feedback with 3-second toast feedback
|
||||
- explain each health metric in plain language
|
||||
|
||||
## Validation
|
||||
|
||||
- run backend pytest
|
||||
- run frontend build
|
||||
- deploy `api + worker + frontend`
|
||||
- smoke-check:
|
||||
- `admin` is the only super admin
|
||||
- department list and user list load
|
||||
- workspace department switch filters knowledge bases
|
||||
- Dify health opens from username menu and stale recovery shows toast
|
||||
@@ -0,0 +1,24 @@
|
||||
# Convert Watchdog And Integration API Plan
|
||||
> **For agent:** REQUIRED SUB-SKILL: Use Section 4 or Section 5 to implement this plan.
|
||||
**Goal:** Add self-healing for stuck local conversion jobs, expose a read-only integration API for other internal sites, and finish the server path migration to `/home/inspur/tools/document-cleaning` without leaving old deployment paths behind.
|
||||
**Architecture:** Extend the existing watchdog service into a shared health/recovery layer for both sync and convert jobs, then wire the host watchdog script to observe the local RQ queue and restart the local worker when it stalls. Add a separate token-protected integration router that exposes knowledge-base, file, version, and download relationships without direct database access.
|
||||
**Tech Stack:** FastAPI, SQLAlchemy, Redis/RQ, Vue (existing UI untouched for this task), Docker Compose, host-side watchdog Python script.
|
||||
|
||||
## Scope
|
||||
- Local convert stale detection and recovery
|
||||
- Host watchdog extension for local RQ queue / worker recovery
|
||||
- Token-protected external read-only API
|
||||
- Server cron/path updates from old project root to `/home/inspur/tools/document-cleaning`
|
||||
- Verification on both local tests and deployed server
|
||||
|
||||
## Non-Goals
|
||||
- PostgreSQL storage relocation
|
||||
- New UI surfaces for convert watchdog
|
||||
- Multi-tenant API key management
|
||||
|
||||
## Task Outline
|
||||
1. Add convert health summary and stale-recovery services plus tests.
|
||||
2. Extend watchdog CLI and host watchdog script to monitor the local convert queue and restart the app worker when it stalls.
|
||||
3. Add integration API settings, auth dependency, endpoints, and tests.
|
||||
4. Sync the latest code to `/home/inspur/tools/document-cleaning`, update cron/default paths, and remove old deployment paths.
|
||||
5. Run local tests, rebuild the server, and verify the new endpoints and watchdog behavior.
|
||||
@@ -0,0 +1,35 @@
|
||||
# Codex Skills Governance
|
||||
|
||||
This folder keeps skill governance assets separate from the application code in `backend/` and `frontend/`.
|
||||
|
||||
## Purpose
|
||||
|
||||
- Record which Codex skills are required by this project
|
||||
- Keep a repeatable install script in the repo
|
||||
- Preserve a local audit trail for the installed skill versions
|
||||
- Define when each skill must be used during future development
|
||||
|
||||
## Required Skills
|
||||
|
||||
- `skill-vetter`
|
||||
- `superpowers`
|
||||
- `frontend-design`
|
||||
|
||||
## Layout
|
||||
|
||||
- `install-skills.ps1`: reinstalls the required skills into `~/.codex/skills`
|
||||
- `sources.json`: canonical source URLs and local install targets
|
||||
- `vetting-report.md`: lightweight security and scope review
|
||||
- `snapshots/`: local copies of the installed skill folders for audit/reference
|
||||
|
||||
## Rule
|
||||
|
||||
For future work on this repo:
|
||||
|
||||
1. Vet any new external skill with `skill-vetter` before installation.
|
||||
2. Use `superpowers` for task framing, planning, execution, testing, and review.
|
||||
3. Use `frontend-design` for any UI or page-level changes.
|
||||
|
||||
## Note
|
||||
|
||||
Skills installed into `~/.codex/skills` require a Codex restart before they become available in a new session.
|
||||
@@ -0,0 +1,73 @@
|
||||
param(
|
||||
[string]$DestRoot = "$env:USERPROFILE\.codex\skills",
|
||||
[switch]$Force
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
$skills = @(
|
||||
@{
|
||||
Name = "skill-vetter"
|
||||
Owner = "openclaw"
|
||||
Repo = "skills"
|
||||
Path = "skills/spclaudehome/skill-vetter"
|
||||
},
|
||||
@{
|
||||
Name = "superpowers"
|
||||
Owner = "openclaw"
|
||||
Repo = "skills"
|
||||
Path = "skills/cutd/claw-superpowers"
|
||||
},
|
||||
@{
|
||||
Name = "frontend-design"
|
||||
Owner = "vadimcomanescu"
|
||||
Repo = "codex-skills"
|
||||
Path = "skills/.curated/design/frontend-design"
|
||||
}
|
||||
)
|
||||
|
||||
function Get-GitHubJson([string]$Url) {
|
||||
Invoke-RestMethod -Headers @{ "User-Agent" = "document-cleaning-skill-bootstrap" } -Uri $Url
|
||||
}
|
||||
|
||||
function Download-GitHubFolder(
|
||||
[string]$Owner,
|
||||
[string]$Repo,
|
||||
[string]$Path,
|
||||
[string]$Dest
|
||||
) {
|
||||
New-Item -ItemType Directory -Force -Path $Dest | Out-Null
|
||||
$api = "https://api.github.com/repos/$Owner/$Repo/contents/$Path"
|
||||
$items = Get-GitHubJson $api
|
||||
|
||||
foreach ($item in $items) {
|
||||
if ($item.type -eq "file") {
|
||||
$target = Join-Path $Dest $item.name
|
||||
Invoke-WebRequest -Headers @{ "User-Agent" = "document-cleaning-skill-bootstrap" } -Uri $item.download_url -OutFile $target
|
||||
continue
|
||||
}
|
||||
|
||||
if ($item.type -eq "dir") {
|
||||
Download-GitHubFolder -Owner $Owner -Repo $Repo -Path $item.path -Dest (Join-Path $Dest $item.name)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
New-Item -ItemType Directory -Force -Path $DestRoot | Out-Null
|
||||
|
||||
foreach ($skill in $skills) {
|
||||
$dest = Join-Path $DestRoot $skill.Name
|
||||
if ((Test-Path $dest) -and -not $Force) {
|
||||
Write-Host "Skipping $($skill.Name) because it already exists. Use -Force to reinstall."
|
||||
continue
|
||||
}
|
||||
|
||||
if (Test-Path $dest) {
|
||||
Remove-Item -Recurse -Force -LiteralPath $dest
|
||||
}
|
||||
|
||||
Download-GitHubFolder -Owner $skill.Owner -Repo $skill.Repo -Path $skill.Path -Dest $dest
|
||||
Write-Host "Installed $($skill.Name) -> $dest"
|
||||
}
|
||||
|
||||
Write-Host "Restart Codex to pick up new skills."
|
||||
@@ -0,0 +1,22 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2026 Vadim Comanescu
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
@@ -0,0 +1,110 @@
|
||||
---
|
||||
name: frontend-design
|
||||
description: "Create distinctive, production-grade frontend UI with a bold, intentional aesthetic direction, purposeful layouts, meaningful motion, and strong accessibility. Prefer React + Next.js (TypeScript), but support vanilla HTML/CSS/JS when appropriate."
|
||||
---
|
||||
|
||||
# Frontend Design
|
||||
|
||||
Build memorable, functional interfaces with a clear point-of-view (no generic templates). Commit to one aesthetic direction, define tokens, ship accessible + responsive UI, and keep changes scoped.
|
||||
|
||||
## Preferred Targets (choose the best fit)
|
||||
1) **Next.js (TypeScript)**: preferred for production app/marketing routes and design system work.
|
||||
2) **React (TypeScript)**: preferred for SPA/component libraries outside Next.js.
|
||||
3) **Vanilla HTML/CSS/JS**: great for static demos, prototypes, and standalone embeds.
|
||||
|
||||
## Quick Start (do this first)
|
||||
1) Ask up to 4 questions:
|
||||
- What user and job-to-be-done (what should feel “easy” after the change)?
|
||||
- Where does it live (component/route) and what stack? Prefer Next.js/React; vanilla is fine for standalone pages or prototypes.
|
||||
- In Next.js: assume App Router (`app/`). Any server/client constraints?
|
||||
- Any hard constraints (brand tokens, light/dark, motion limits, must-keep UI parts, perf budgets)?
|
||||
2) Pick an aesthetic direction + **one signature move**. If vague, propose 2–3 options from `references/aesthetic-playbook.md`.
|
||||
3) Define tokens (type, palette, spacing, radius, shadows, motion). Keep accents to 1–2.
|
||||
4) Build structure first (semantic markup + layout), then motion, then polish + QA.
|
||||
|
||||
## Guardrails (avoid footguns)
|
||||
- Keep scope tight: redesign only what the user asked for.
|
||||
- Reuse existing tokens/components if working in an existing repo; do not introduce a new global styling system unless requested.
|
||||
- Match complexity to the vision: refined minimalism needs restraint; maximalism needs deliberate structure (not random decoration).
|
||||
- Respect `prefers-reduced-motion` for all animations.
|
||||
- Avoid “AI slop” defaults. If the repo already uses a generic font, keep it unless the user explicitly wants new typography.
|
||||
- Enforce token semantics: error/success/warning colors are for meaning, not decoration; keep contrast accessible in light/dark.
|
||||
- Default to shipping code that is easy to maintain: small components, clear hierarchy, minimal dependencies.
|
||||
- Don’t add new packages (animation libs, UI kits, icon sets) unless the user explicitly asks or the repo already uses them.
|
||||
- Default to one primary CTA per view; demote the rest (secondary/tertiary) to avoid competing actions.
|
||||
|
||||
## Workflow
|
||||
|
||||
### 1) Commit to a direction
|
||||
- Declare: aesthetic direction, palette mood, type pairing, and the signature move.
|
||||
- Write a 1–2 sentence design thesis that explains the hierarchy and vibe.
|
||||
- Use `references/anti-patterns.md` to avoid predictable layouts and cliched palettes.
|
||||
|
||||
### 1b) Design system rules (strict vs flexible)
|
||||
- **Strict**: semantic color meaning, readable type ramp, reduced motion, visible focus, and “human-in-control” for AI actions (undo/apply/confirm).
|
||||
- **Flexible**: brand accent hue, surface “temperature” in dark mode, and density preset (compact vs comfy).
|
||||
- **When to read more**: load `references/tokens-and-semantics.md` when defining tokens and `references/ai-native-ui-patterns.md` when adding AI surfaces.
|
||||
|
||||
### 1a) React/Next.js coding guidance (read when implementing)
|
||||
- **React fundamentals**: keep components pure; prefer event handlers over Effects for user-driven work; follow the Rules of Hooks.
|
||||
- **Next.js App Router**: keep Client Components small; use Server Components by default; mark `"use client"` only where you need state, effects, or browser APIs.
|
||||
- **Data fetching**: prefer server-side `fetch` and explicit cache/revalidate controls; avoid unnecessary client-side effects for data.
|
||||
- **When to read more**: load `references/react-next-best-practices.md` before writing complex React logic or introducing new data fetching patterns.
|
||||
|
||||
### 2) Plan tokens and layout (before details)
|
||||
- Define CSS variables (or a theme object) for:
|
||||
- Color: background/surface/ink/muted/accent(+optional accent2)
|
||||
- Type: display/body/mono, size scale, line-height
|
||||
- Shape: radius scale and border rules
|
||||
- Depth: shadow and outline rules
|
||||
- Motion: durations + easing + reveal stagger step
|
||||
- Lay out the page/component skeleton and content hierarchy.
|
||||
- Reference `references/implementation-patterns.md` for patterns and QA.
|
||||
|
||||
### 3) Implement (ship code, not moodboards)
|
||||
- Start with semantic structure and accessible interactions (keyboard + focus states).
|
||||
- Build macro layout with Grid; micro layout with Flexbox.
|
||||
- For Next.js/React, keep components small and composable; prefer CSS Modules or the repo’s existing styling approach.
|
||||
- Use “link for navigation, button for actions” to keep semantics and keyboard behavior correct.
|
||||
- Apply the signature move sparingly but decisively (one memorable thing, not ten).
|
||||
- Add motion as orchestration (one strong page-load + a few micro-interactions), not random flourishes.
|
||||
|
||||
### 3a) Next.js implementation notes (when applicable)
|
||||
- **App Router only**: assume `app/` routing (not `pages/`).
|
||||
- **Server vs Client**: default to Server Components; add `"use client"` only for interactive islands.
|
||||
- **Data + state**: keep data fetching on the server when possible; keep client state local and purposeful.
|
||||
- **Performance**: avoid layout shift (stable heights, predictable grids); keep blur/shadows paint-friendly on mobile.
|
||||
- **Platform primitives**: prefer `next/link` for navigation and `next/image` for real images when available.
|
||||
- **Fonts**: if changing typography in Next.js, prefer `next/font` to avoid FOIT/FOUT surprises.
|
||||
- **Styling**: keep it consistent—CSS Modules, Tailwind, or the existing system; don’t introduce a new one without asking.
|
||||
|
||||
### 3b) Content + states (don’t ship empty shells)
|
||||
- Define loading, empty, and error states for any data-driven UI.
|
||||
- Keep copy tight and purposeful; avoid placeholder lorem unless asked.
|
||||
- Preserve existing product terminology unless the user requests copy changes.
|
||||
|
||||
### 4) Polish and QA
|
||||
- Responsive pass: collapse grids, maintain padding, preserve CTA prominence on mobile.
|
||||
- Accessibility pass: landmarks, one `h1`, labels, contrast, focus order, skip link when relevant.
|
||||
- Performance pass: avoid expensive shadows on mobile, keep animation paint-friendly, avoid large images.
|
||||
|
||||
## Definition of Done
|
||||
- Layout looks intentional at mobile + desktop breakpoints (no cramped type, no orphan CTAs).
|
||||
- Focus states are visible, tab order is logical, and motion respects `prefers-reduced-motion`.
|
||||
- Tokens are centralized (CSS variables/theme), and the signature move is present but not overused.
|
||||
|
||||
## Deliverables (how to present results)
|
||||
- List files changed and what they do.
|
||||
- Explain the aesthetic direction + signature move (1–2 sentences).
|
||||
- Provide commands to validate (use the repo’s conventions; common ones include `npm run dev`, `npm run lint`, `npm test`).
|
||||
|
||||
## Bundled Resources
|
||||
- `references/aesthetic-playbook.md`: strong directions, type+color cues, signature moves.
|
||||
- `references/implementation-patterns.md`: layout/motion/a11y patterns for vanilla + React.
|
||||
- `references/anti-patterns.md`: quick “don’t do this” checklist to avoid generic output.
|
||||
- `references/react-next-best-practices.md`: React + Next.js coding guidelines (hooks, effects, server/client, data fetching).
|
||||
- `references/tokens-and-semantics.md`: token semantics, type ramp, dark mode, and density rules (strict vs flexible).
|
||||
- `references/ai-native-ui-patterns.md`: copilot panels, citations, disclosures, and human-in-the-loop UI patterns.
|
||||
- `assets/vanilla-starter/`: runnable vanilla starter you can copy + retheme via CSS variables.
|
||||
- `assets/react-component-starter/`: small React component + CSS module skeleton to retheme.
|
||||
- `assets/nextjs-app-router-starter/`: minimal Next.js App Router page + tokens you can copy and retheme.
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
# Next.js App Router Starter
|
||||
|
||||
Copy these files into an existing Next.js App Router project to bootstrap a strongly-themed, token-driven page.
|
||||
|
||||
- Files assume `app/` routing (not `pages/`).
|
||||
- Uses CSS variables + CSS Modules (no external styling dependencies).
|
||||
- Designed to be rethemed by editing `app/globals.css` tokens.
|
||||
- Includes an “Assistant Rail” component demonstrating AI-native UX patterns (AI disclosure, citations, and human-in-control apply/undo).
|
||||
+69
@@ -0,0 +1,69 @@
|
||||
:root {
|
||||
--bg: #0b0d12;
|
||||
--surface: rgba(255, 255, 255, 0.06);
|
||||
--surface-2: rgba(255, 255, 255, 0.1);
|
||||
--ink: rgba(255, 255, 255, 0.92);
|
||||
--muted: rgba(255, 255, 255, 0.68);
|
||||
--accent: #6ee7ff;
|
||||
--danger: #ff5a7a;
|
||||
--warning: #ffcc66;
|
||||
--success: #55f2b1;
|
||||
--info: #6ea8ff;
|
||||
|
||||
--radius-sm: 10px;
|
||||
--radius-md: 16px;
|
||||
--radius-lg: 22px;
|
||||
|
||||
--shadow-sm: 0 10px 30px rgba(0, 0, 0, 0.28);
|
||||
--shadow-md: 0 22px 70px rgba(0, 0, 0, 0.4);
|
||||
|
||||
--container: 1120px;
|
||||
--gutter: clamp(16px, 3vw, 28px);
|
||||
--grid-gap: clamp(14px, 2vw, 22px);
|
||||
|
||||
--ease-out: cubic-bezier(0.16, 1, 0.3, 1);
|
||||
--dur-1: 140ms;
|
||||
--dur-2: 240ms;
|
||||
--dur-3: 420ms;
|
||||
}
|
||||
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
html,
|
||||
body {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
background: radial-gradient(1200px 900px at 18% -10%, rgba(110, 231, 255, 0.18), transparent 55%),
|
||||
radial-gradient(900px 700px at 78% 10%, rgba(255, 115, 224, 0.14), transparent 60%),
|
||||
var(--bg);
|
||||
color: var(--ink);
|
||||
font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial,
|
||||
"Apple Color Emoji", "Segoe UI Emoji";
|
||||
line-height: 1.45;
|
||||
}
|
||||
|
||||
a {
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
:focus-visible {
|
||||
outline: 2px solid color-mix(in oklab, var(--accent), white 10%);
|
||||
outline-offset: 3px;
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
*,
|
||||
*::before,
|
||||
*::after {
|
||||
animation-duration: 0.01ms !important;
|
||||
animation-iteration-count: 1 !important;
|
||||
transition-duration: 0.01ms !important;
|
||||
scroll-behavior: auto !important;
|
||||
}
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
import type { Metadata } from "next";
|
||||
import "./globals.css";
|
||||
import type { ReactNode } from "react";
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "Frontend Design Starter",
|
||||
description: "Token-driven Next.js starter page for rapid retheming.",
|
||||
};
|
||||
|
||||
export default function RootLayout({
|
||||
children,
|
||||
}: Readonly<{ children: ReactNode }>) {
|
||||
return (
|
||||
<html lang="en">
|
||||
<body>{children}</body>
|
||||
</html>
|
||||
);
|
||||
}
|
||||
+244
@@ -0,0 +1,244 @@
|
||||
.page {
|
||||
min-height: 100dvh;
|
||||
}
|
||||
|
||||
.skip {
|
||||
position: absolute;
|
||||
left: -999px;
|
||||
top: 12px;
|
||||
padding: 10px 12px;
|
||||
border-radius: 999px;
|
||||
background: var(--surface-2);
|
||||
}
|
||||
|
||||
.skip:focus {
|
||||
left: 12px;
|
||||
}
|
||||
|
||||
.topbar {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 10;
|
||||
backdrop-filter: blur(18px);
|
||||
background: color-mix(in oklab, var(--bg), transparent 35%);
|
||||
border-bottom: 1px solid color-mix(in oklab, white, transparent 90%);
|
||||
}
|
||||
|
||||
.topbarInner {
|
||||
max-width: var(--container);
|
||||
margin: 0 auto;
|
||||
padding: 14px var(--gutter);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 18px;
|
||||
}
|
||||
|
||||
.brand {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
font-weight: 650;
|
||||
letter-spacing: 0.02em;
|
||||
}
|
||||
|
||||
.mark {
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
border-radius: 10px;
|
||||
background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.45), transparent 60%),
|
||||
linear-gradient(135deg, rgba(110, 231, 255, 0.85), rgba(255, 115, 224, 0.62));
|
||||
box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
|
||||
}
|
||||
|
||||
.nav {
|
||||
display: flex;
|
||||
gap: 14px;
|
||||
color: var(--muted);
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.nav a {
|
||||
padding: 8px 10px;
|
||||
border-radius: 999px;
|
||||
}
|
||||
|
||||
.nav a:hover {
|
||||
background: rgba(255, 255, 255, 0.06);
|
||||
color: var(--ink);
|
||||
}
|
||||
|
||||
.hero {
|
||||
max-width: var(--container);
|
||||
margin: 0 auto;
|
||||
padding: 54px var(--gutter) 28px;
|
||||
display: grid;
|
||||
grid-template-columns: 1.15fr 0.85fr;
|
||||
gap: clamp(18px, 3vw, 36px);
|
||||
align-items: start;
|
||||
}
|
||||
|
||||
.headline {
|
||||
margin: 0;
|
||||
font-size: clamp(34px, 4vw, 56px);
|
||||
line-height: 1.03;
|
||||
letter-spacing: -0.02em;
|
||||
}
|
||||
|
||||
.lede {
|
||||
margin: 14px 0 0;
|
||||
color: var(--muted);
|
||||
font-size: clamp(16px, 1.4vw, 18px);
|
||||
max-width: 58ch;
|
||||
}
|
||||
|
||||
.ctaRow {
|
||||
margin-top: 20px;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.btn {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
padding: 11px 14px;
|
||||
border-radius: 999px;
|
||||
border: 1px solid color-mix(in oklab, white, transparent 85%);
|
||||
background: rgba(255, 255, 255, 0.04);
|
||||
box-shadow: var(--shadow-sm);
|
||||
transition: transform var(--dur-2) var(--ease-out), background var(--dur-2) var(--ease-out),
|
||||
border-color var(--dur-2) var(--ease-out);
|
||||
}
|
||||
|
||||
.btn:hover {
|
||||
transform: translateY(-1px);
|
||||
background: rgba(255, 255, 255, 0.07);
|
||||
border-color: color-mix(in oklab, var(--accent), white 35%);
|
||||
}
|
||||
|
||||
.btnPrimary {
|
||||
border-color: color-mix(in oklab, var(--accent), white 40%);
|
||||
background: linear-gradient(
|
||||
180deg,
|
||||
rgba(110, 231, 255, 0.22),
|
||||
rgba(255, 255, 255, 0.06)
|
||||
);
|
||||
}
|
||||
|
||||
.panel {
|
||||
border-radius: var(--radius-lg);
|
||||
background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03));
|
||||
border: 1px solid color-mix(in oklab, white, transparent 88%);
|
||||
box-shadow: var(--shadow-md);
|
||||
padding: 18px;
|
||||
}
|
||||
|
||||
.rail {
|
||||
margin-top: 16px;
|
||||
}
|
||||
|
||||
.panelHeader {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
justify-content: space-between;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.panelTitle {
|
||||
margin: 0;
|
||||
font-size: 15px;
|
||||
letter-spacing: 0.02em;
|
||||
color: color-mix(in oklab, var(--muted), white 18%);
|
||||
}
|
||||
|
||||
.badge {
|
||||
font-size: 12px;
|
||||
color: color-mix(in oklab, var(--accent), white 20%);
|
||||
background: rgba(110, 231, 255, 0.12);
|
||||
border: 1px solid rgba(110, 231, 255, 0.28);
|
||||
padding: 6px 10px;
|
||||
border-radius: 999px;
|
||||
}
|
||||
|
||||
.list {
|
||||
margin: 14px 0 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
display: grid;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.item {
|
||||
border-radius: var(--radius-md);
|
||||
background: rgba(255, 255, 255, 0.04);
|
||||
border: 1px solid rgba(255, 255, 255, 0.06);
|
||||
padding: 12px 12px;
|
||||
}
|
||||
|
||||
.itemTitle {
|
||||
font-weight: 620;
|
||||
margin: 0;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.itemBody {
|
||||
margin: 6px 0 0;
|
||||
color: var(--muted);
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.content {
|
||||
max-width: var(--container);
|
||||
margin: 0 auto;
|
||||
padding: 28px var(--gutter) 64px;
|
||||
}
|
||||
|
||||
.grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(12, 1fr);
|
||||
gap: var(--grid-gap);
|
||||
}
|
||||
|
||||
.card {
|
||||
grid-column: span 4;
|
||||
border-radius: var(--radius-lg);
|
||||
background: rgba(255, 255, 255, 0.04);
|
||||
border: 1px solid rgba(255, 255, 255, 0.07);
|
||||
padding: 18px;
|
||||
transition: transform var(--dur-2) var(--ease-out), border-color var(--dur-2) var(--ease-out);
|
||||
}
|
||||
|
||||
.card:hover {
|
||||
transform: translateY(-2px);
|
||||
border-color: color-mix(in oklab, var(--accent), white 35%);
|
||||
}
|
||||
|
||||
.card h2 {
|
||||
margin: 0 0 8px;
|
||||
font-size: 16px;
|
||||
letter-spacing: 0.01em;
|
||||
}
|
||||
|
||||
.card p {
|
||||
margin: 0;
|
||||
color: var(--muted);
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
@media (max-width: 900px) {
|
||||
.hero {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.card {
|
||||
grid-column: span 6;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 560px) {
|
||||
.card {
|
||||
grid-column: span 12;
|
||||
}
|
||||
}
|
||||
+99
@@ -0,0 +1,99 @@
|
||||
import styles from "./page.module.css";
|
||||
import { AssistantRail } from "../components/AssistantRail";
|
||||
|
||||
const quickWins = [
|
||||
{
|
||||
title: "Token-first styling",
|
||||
body: "Retheme fast by editing CSS variables in globals.css (palette, radii, shadows, motion).",
|
||||
},
|
||||
{
|
||||
title: "One signature move",
|
||||
body: "Commit to a single memorable gesture (light sweep, stripe, grain, or brutal border logic).",
|
||||
},
|
||||
{
|
||||
title: "Accessible by default",
|
||||
body: "Semantic structure, visible focus, and reduced-motion support are built in.",
|
||||
},
|
||||
];
|
||||
|
||||
export default function Page() {
|
||||
return (
|
||||
<div className={styles.page}>
|
||||
<a className={styles.skip} href="#content">
|
||||
Skip to content
|
||||
</a>
|
||||
|
||||
<header className={styles.topbar}>
|
||||
<div className={styles.topbarInner}>
|
||||
<a className={styles.brand} href="#">
|
||||
<span aria-hidden className={styles.mark} />
|
||||
Frontend Design
|
||||
</a>
|
||||
<nav className={styles.nav} aria-label="Primary">
|
||||
<a href="#principles">Principles</a>
|
||||
<a href="#cards">Patterns</a>
|
||||
<a href="#cta">CTA</a>
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<main id="content">
|
||||
<section className={styles.hero} aria-labelledby="headline">
|
||||
<div>
|
||||
<h1 id="headline" className={styles.headline}>
|
||||
A token-driven page that looks intentional on day one.
|
||||
</h1>
|
||||
<p className={styles.lede}>
|
||||
Build structure first, then motion, then polish. Keep the UI memorable with one
|
||||
signature move—not ten random decorations.
|
||||
</p>
|
||||
<div className={styles.ctaRow} id="cta">
|
||||
<a className={`${styles.btn} ${styles.btnPrimary}`} href="#">
|
||||
Start a redesign <span aria-hidden>→</span>
|
||||
</a>
|
||||
<a className={styles.btn} href="#cards">
|
||||
See patterns
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<aside className={styles.panel} aria-label="Quick Wins" id="principles">
|
||||
<div className={styles.panelHeader}>
|
||||
<h2 className={styles.panelTitle}>Quick Wins</h2>
|
||||
<span className={styles.badge}>Next.js App Router</span>
|
||||
</div>
|
||||
<ul className={styles.list}>
|
||||
{quickWins.map((item) => (
|
||||
<li key={item.title} className={styles.item}>
|
||||
<p className={styles.itemTitle}>{item.title}</p>
|
||||
<p className={styles.itemBody}>{item.body}</p>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</aside>
|
||||
|
||||
<div className={styles.rail}>
|
||||
<AssistantRail />
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section className={styles.content} aria-labelledby="cards" id="cards">
|
||||
<div className={styles.grid}>
|
||||
<article className={styles.card}>
|
||||
<h2>Hierarchy</h2>
|
||||
<p>Make the primary action obvious, then design the supporting rails.</p>
|
||||
</article>
|
||||
<article className={styles.card}>
|
||||
<h2>Texture</h2>
|
||||
<p>Use subtle grain/mesh/stripe logic to avoid flat UI without clutter.</p>
|
||||
</article>
|
||||
<article className={styles.card}>
|
||||
<h2>Motion</h2>
|
||||
<p>Orchestrate a few meaningful reveals and micro-interactions—guarded by settings.</p>
|
||||
</article>
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
+217
@@ -0,0 +1,217 @@
|
||||
.wrap {
|
||||
display: grid;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.panel {
|
||||
border-radius: var(--radius-lg);
|
||||
background: linear-gradient(
|
||||
180deg,
|
||||
rgba(255, 255, 255, 0.07),
|
||||
rgba(255, 255, 255, 0.03)
|
||||
);
|
||||
border: 1px solid color-mix(in oklab, white, transparent 88%);
|
||||
box-shadow: var(--shadow-md);
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
.header {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
justify-content: space-between;
|
||||
gap: 12px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.title {
|
||||
margin: 0;
|
||||
font-size: 15px;
|
||||
letter-spacing: 0.02em;
|
||||
color: color-mix(in oklab, var(--muted), white 18%);
|
||||
}
|
||||
|
||||
.disclosure {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.badge {
|
||||
font-size: 12px;
|
||||
color: color-mix(in oklab, var(--accent), white 18%);
|
||||
background: rgba(110, 231, 255, 0.12);
|
||||
border: 1px solid rgba(110, 231, 255, 0.28);
|
||||
padding: 6px 10px;
|
||||
border-radius: 999px;
|
||||
}
|
||||
|
||||
.hint {
|
||||
font-size: 12px;
|
||||
color: var(--muted);
|
||||
}
|
||||
|
||||
.promptRow {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.input {
|
||||
flex: 1;
|
||||
border-radius: 12px;
|
||||
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||
background: rgba(0, 0, 0, 0.12);
|
||||
color: var(--ink);
|
||||
padding: 10px 12px;
|
||||
font: inherit;
|
||||
}
|
||||
|
||||
.input::placeholder {
|
||||
color: color-mix(in oklab, var(--muted), transparent 10%);
|
||||
}
|
||||
|
||||
.btn {
|
||||
border-radius: 999px;
|
||||
border: 1px solid color-mix(in oklab, white, transparent 85%);
|
||||
background: rgba(255, 255, 255, 0.04);
|
||||
color: var(--ink);
|
||||
padding: 10px 12px;
|
||||
font: inherit;
|
||||
cursor: pointer;
|
||||
transition: transform var(--dur-2) var(--ease-out), background var(--dur-2) var(--ease-out),
|
||||
border-color var(--dur-2) var(--ease-out);
|
||||
}
|
||||
|
||||
.btn:hover {
|
||||
transform: translateY(-1px);
|
||||
background: rgba(255, 255, 255, 0.07);
|
||||
border-color: color-mix(in oklab, var(--accent), white 35%);
|
||||
}
|
||||
|
||||
.btnPrimary {
|
||||
border-color: color-mix(in oklab, var(--accent), white 40%);
|
||||
background: linear-gradient(
|
||||
180deg,
|
||||
rgba(110, 231, 255, 0.2),
|
||||
rgba(255, 255, 255, 0.06)
|
||||
);
|
||||
}
|
||||
|
||||
.output {
|
||||
margin-top: 12px;
|
||||
border-radius: var(--radius-md);
|
||||
border: 1px solid rgba(255, 255, 255, 0.08);
|
||||
background: rgba(255, 255, 255, 0.03);
|
||||
padding: 12px;
|
||||
}
|
||||
|
||||
.typing {
|
||||
display: inline-flex;
|
||||
gap: 6px;
|
||||
align-items: center;
|
||||
color: var(--muted);
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.dot {
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
border-radius: 999px;
|
||||
background: color-mix(in oklab, var(--accent), white 15%);
|
||||
opacity: 0.6;
|
||||
animation: pulse 900ms var(--ease-out) infinite;
|
||||
}
|
||||
|
||||
.dot:nth-child(2) {
|
||||
animation-delay: 120ms;
|
||||
}
|
||||
|
||||
.dot:nth-child(3) {
|
||||
animation-delay: 240ms;
|
||||
}
|
||||
|
||||
@keyframes pulse {
|
||||
0%,
|
||||
100% {
|
||||
transform: translateY(0);
|
||||
opacity: 0.45;
|
||||
}
|
||||
50% {
|
||||
transform: translateY(-1px);
|
||||
opacity: 0.9;
|
||||
}
|
||||
}
|
||||
|
||||
.text {
|
||||
margin: 0;
|
||||
color: color-mix(in oklab, var(--ink), white 2%);
|
||||
font-size: 13px;
|
||||
line-height: 1.45;
|
||||
}
|
||||
|
||||
.citations {
|
||||
margin-top: 10px;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.chip {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
padding: 7px 10px;
|
||||
border-radius: 999px;
|
||||
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||
background: rgba(255, 255, 255, 0.04);
|
||||
color: var(--muted);
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.chipNumber {
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
border-radius: 999px;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: rgba(110, 231, 255, 0.14);
|
||||
border: 1px solid rgba(110, 231, 255, 0.26);
|
||||
color: color-mix(in oklab, var(--accent), white 20%);
|
||||
font-weight: 650;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.controls {
|
||||
margin-top: 12px;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 10px;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.controlRow {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.whyRow {
|
||||
margin-top: 12px;
|
||||
}
|
||||
|
||||
.status {
|
||||
font-size: 12px;
|
||||
color: var(--muted);
|
||||
}
|
||||
|
||||
.statusStrong {
|
||||
color: color-mix(in oklab, var(--success), white 18%);
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.dot {
|
||||
animation: none;
|
||||
}
|
||||
}
|
||||
+167
@@ -0,0 +1,167 @@
|
||||
"use client";
|
||||
|
||||
import { useMemo, useState } from "react";
|
||||
import styles from "./AssistantRail.module.css";
|
||||
|
||||
type Suggestion = {
|
||||
id: string;
|
||||
text: string;
|
||||
citations: Array<{ title: string; href: string }>;
|
||||
};
|
||||
|
||||
const seededSuggestions: Suggestion[] = [
|
||||
{
|
||||
id: "cta",
|
||||
text: "Reduce competing CTAs: keep one primary action, demote the rest to secondary to sharpen hierarchy.",
|
||||
citations: [
|
||||
{ title: "Design System: CTA hierarchy", href: "#" },
|
||||
{ title: "UX principle: one primary per view", href: "#" },
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "motion",
|
||||
text: "Use motion only as feedback (hover, state changes, subtle reveal). Respect reduced-motion automatically.",
|
||||
citations: [
|
||||
{ title: "Motion guidelines", href: "#" },
|
||||
{ title: "Reduced motion support", href: "#" },
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
export function AssistantRail() {
|
||||
const [prompt, setPrompt] = useState("Summarize how to improve this page’s hierarchy.");
|
||||
const [isGenerating, setIsGenerating] = useState(false);
|
||||
const [active, setActive] = useState<Suggestion | null>(seededSuggestions[0]);
|
||||
const [appliedIds, setAppliedIds] = useState<string[]>([]);
|
||||
const [lastAppliedId, setLastAppliedId] = useState<string | null>(null);
|
||||
const [showWhy, setShowWhy] = useState(false);
|
||||
|
||||
const appliedSet = useMemo(() => new Set(appliedIds), [appliedIds]);
|
||||
|
||||
function run() {
|
||||
setIsGenerating(true);
|
||||
window.setTimeout(() => {
|
||||
const promptLower = prompt.toLowerCase();
|
||||
const keywordMatch =
|
||||
promptLower.includes("motion") || promptLower.includes("animation")
|
||||
? "motion"
|
||||
: promptLower.includes("cta") || promptLower.includes("button")
|
||||
? "cta"
|
||||
: null;
|
||||
|
||||
const next =
|
||||
(keywordMatch ? seededSuggestions.find((s) => s.id === keywordMatch) : null) ??
|
||||
(() => {
|
||||
const currentIndex = seededSuggestions.findIndex((s) => s.id === (active?.id ?? seededSuggestions[0].id));
|
||||
const nextIndex = (currentIndex + 1) % seededSuggestions.length;
|
||||
return seededSuggestions[nextIndex];
|
||||
})();
|
||||
setActive(next);
|
||||
setShowWhy(false);
|
||||
setIsGenerating(false);
|
||||
}, 700);
|
||||
}
|
||||
|
||||
function apply() {
|
||||
if (!active || appliedSet.has(active.id)) return;
|
||||
setAppliedIds((prev) => [...prev, active.id]);
|
||||
setLastAppliedId(active.id);
|
||||
}
|
||||
|
||||
function undo() {
|
||||
if (!lastAppliedId) return;
|
||||
setAppliedIds((prev) => prev.filter((id) => id !== lastAppliedId));
|
||||
setLastAppliedId(null);
|
||||
}
|
||||
|
||||
function resetApplied() {
|
||||
if (!appliedIds.length) return;
|
||||
const ok = window.confirm("Clear applied items? This is just a demo of confirmation UI.");
|
||||
if (!ok) return;
|
||||
setAppliedIds([]);
|
||||
setLastAppliedId(null);
|
||||
}
|
||||
|
||||
return (
|
||||
<section className={styles.panel} aria-label="AI Assistant">
|
||||
<div className={styles.header}>
|
||||
<h2 className={styles.title}>Assistant Rail</h2>
|
||||
<div className={styles.disclosure}>
|
||||
<span className={styles.badge} title="This content is generated by AI. Review before applying.">
|
||||
AI-generated
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p className={styles.hint}>
|
||||
Human-in-control: you can apply or undo changes. This is a starter UI pattern, not a full chatbot.
|
||||
</p>
|
||||
|
||||
<div className={styles.promptRow}>
|
||||
<input
|
||||
className={styles.input}
|
||||
value={prompt}
|
||||
onChange={(e) => setPrompt(e.target.value)}
|
||||
placeholder="Ask for a UI change…"
|
||||
aria-label="Prompt"
|
||||
/>
|
||||
<button className={`${styles.btn} ${styles.btnPrimary}`} type="button" onClick={run}>
|
||||
Ask
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div className={styles.output} aria-live="polite">
|
||||
{isGenerating ? (
|
||||
<div className={styles.typing} aria-label="Generating">
|
||||
<span>Thinking</span>
|
||||
<span className={styles.dot} />
|
||||
<span className={styles.dot} />
|
||||
<span className={styles.dot} />
|
||||
</div>
|
||||
) : (
|
||||
<>
|
||||
<p className={styles.text}>{active?.text}</p>
|
||||
<div className={styles.citations} aria-label="Citations">
|
||||
{(active?.citations ?? []).map((c, idx) => (
|
||||
<span key={c.title} className={styles.chip} title={c.title}>
|
||||
<span className={styles.chipNumber}>{idx + 1}</span>
|
||||
<a href={c.href}>{c.title}</a>
|
||||
</span>
|
||||
))}
|
||||
</div>
|
||||
<div className={styles.whyRow}>
|
||||
<button className={styles.btn} type="button" onClick={() => setShowWhy((v) => !v)}>
|
||||
Why this?
|
||||
</button>
|
||||
</div>
|
||||
{showWhy ? (
|
||||
<p className={styles.hint}>
|
||||
This suggestion targets high-leverage UX: clearer hierarchy reduces cognitive load and makes the
|
||||
primary action obvious. It also reduces regret by keeping changes easy to apply/undo.
|
||||
</p>
|
||||
) : null}
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className={styles.controls}>
|
||||
<div className={styles.controlRow}>
|
||||
<button className={styles.btn} type="button" onClick={apply} disabled={!active || appliedSet.has(active.id)}>
|
||||
Apply
|
||||
</button>
|
||||
<button className={styles.btn} type="button" onClick={undo} disabled={!lastAppliedId}>
|
||||
Undo
|
||||
</button>
|
||||
<button className={styles.btn} type="button" onClick={resetApplied} disabled={!appliedIds.length}>
|
||||
Reset
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div className={styles.status} aria-live="polite">
|
||||
Applied:{" "}
|
||||
<span className={appliedIds.length ? styles.statusStrong : undefined}>{appliedIds.length}</span>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
+198
@@ -0,0 +1,198 @@
|
||||
:root {
|
||||
--fd-bg: #0b0d10;
|
||||
--fd-surface: rgba(255, 255, 255, 0.06);
|
||||
--fd-ink: rgba(245, 244, 240, 0.96);
|
||||
--fd-muted: rgba(245, 244, 240, 0.66);
|
||||
--fd-accent: #d7ff3f;
|
||||
--fd-accent2: #68e0ff;
|
||||
--fd-radius: 20px;
|
||||
--fd-stroke: rgba(245, 244, 240, 0.14);
|
||||
--fd-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
|
||||
--fd-ease: cubic-bezier(0.2, 0.9, 0.2, 1);
|
||||
}
|
||||
|
||||
.shell {
|
||||
position: relative;
|
||||
color: var(--fd-ink);
|
||||
border: 1px solid var(--fd-stroke);
|
||||
border-radius: var(--fd-radius);
|
||||
background:
|
||||
radial-gradient(1000px 300px at 20% 0%, rgba(104, 224, 255, 0.14), transparent 60%),
|
||||
radial-gradient(800px 340px at 85% 20%, rgba(215, 255, 63, 0.14), transparent 55%),
|
||||
linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03));
|
||||
box-shadow: var(--fd-shadow);
|
||||
overflow: clip;
|
||||
padding: 22px 20px;
|
||||
}
|
||||
|
||||
.shell::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
pointer-events: none;
|
||||
background:
|
||||
repeating-linear-gradient(
|
||||
135deg,
|
||||
rgba(245, 244, 240, 0.05),
|
||||
rgba(245, 244, 240, 0.05) 1px,
|
||||
transparent 1px,
|
||||
transparent 9px
|
||||
);
|
||||
opacity: 0.35;
|
||||
mix-blend-mode: soft-light;
|
||||
}
|
||||
|
||||
.head {
|
||||
position: relative;
|
||||
padding-bottom: 14px;
|
||||
border-bottom: 1px solid var(--fd-stroke);
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.kicker {
|
||||
display: inline-flex;
|
||||
gap: 10px;
|
||||
align-items: center;
|
||||
font-size: 12px;
|
||||
letter-spacing: 0.14em;
|
||||
text-transform: uppercase;
|
||||
color: var(--fd-muted);
|
||||
}
|
||||
|
||||
.kicker::before {
|
||||
content: "";
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
border-radius: 999px;
|
||||
background: radial-gradient(circle at 35% 35%, var(--fd-accent), rgba(215, 255, 63, 0.2));
|
||||
box-shadow: 0 0 0 2px rgba(215, 255, 63, 0.12);
|
||||
}
|
||||
|
||||
.title {
|
||||
margin: 10px 0 6px;
|
||||
font-size: 28px;
|
||||
line-height: 1.05;
|
||||
letter-spacing: -0.02em;
|
||||
}
|
||||
|
||||
.subtitle {
|
||||
margin: 0;
|
||||
max-width: 62ch;
|
||||
color: var(--fd-muted);
|
||||
line-height: 1.35;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.grid {
|
||||
position: relative;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.card {
|
||||
border: 1px solid rgba(245, 244, 240, 0.12);
|
||||
border-radius: 16px;
|
||||
background: rgba(0, 0, 0, 0.2);
|
||||
padding: 14px 14px 12px;
|
||||
transform: translateY(0);
|
||||
transition: transform 280ms var(--fd-ease), border-color 280ms var(--fd-ease);
|
||||
}
|
||||
|
||||
.card:hover {
|
||||
transform: translateY(-2px);
|
||||
border-color: rgba(215, 255, 63, 0.35);
|
||||
}
|
||||
|
||||
.cardTop {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
gap: 10px;
|
||||
align-items: baseline;
|
||||
}
|
||||
|
||||
.cardLabel {
|
||||
font-size: 12px;
|
||||
letter-spacing: 0.08em;
|
||||
text-transform: uppercase;
|
||||
color: rgba(245, 244, 240, 0.72);
|
||||
}
|
||||
|
||||
.cardHint {
|
||||
font-size: 12px;
|
||||
color: rgba(104, 224, 255, 0.8);
|
||||
}
|
||||
|
||||
.cardValue {
|
||||
margin-top: 12px;
|
||||
font-size: 24px;
|
||||
line-height: 1;
|
||||
letter-spacing: -0.02em;
|
||||
}
|
||||
|
||||
.foot {
|
||||
position: relative;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
margin-top: 16px;
|
||||
}
|
||||
|
||||
.cta {
|
||||
appearance: none;
|
||||
border: 1px solid rgba(245, 244, 240, 0.18);
|
||||
color: var(--fd-ink);
|
||||
background: rgba(0, 0, 0, 0.18);
|
||||
border-radius: 999px;
|
||||
padding: 12px 14px;
|
||||
display: inline-flex;
|
||||
gap: 10px;
|
||||
align-items: center;
|
||||
cursor: pointer;
|
||||
transition: transform 220ms var(--fd-ease), border-color 220ms var(--fd-ease);
|
||||
}
|
||||
|
||||
.cta:hover {
|
||||
transform: translateY(-1px);
|
||||
border-color: rgba(245, 244, 240, 0.34);
|
||||
}
|
||||
|
||||
.cta:focus-visible {
|
||||
outline: 3px solid rgba(104, 224, 255, 0.45);
|
||||
outline-offset: 3px;
|
||||
}
|
||||
|
||||
.ctaText {
|
||||
font-size: 13px;
|
||||
letter-spacing: 0.02em;
|
||||
}
|
||||
|
||||
.ctaIcon {
|
||||
color: var(--fd-accent);
|
||||
transform: translateX(0);
|
||||
transition: transform 220ms var(--fd-ease);
|
||||
}
|
||||
|
||||
.cta:hover .ctaIcon {
|
||||
transform: translateX(2px);
|
||||
}
|
||||
|
||||
@media (max-width: 720px) {
|
||||
.grid {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
.title {
|
||||
font-size: 26px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.card,
|
||||
.cta,
|
||||
.ctaIcon {
|
||||
transition: none;
|
||||
}
|
||||
.card:hover,
|
||||
.cta:hover {
|
||||
transform: none;
|
||||
}
|
||||
}
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
import styles from "./DesignPanel.module.css";
|
||||
|
||||
type Stat = { label: string; value: string; hint?: string };
|
||||
|
||||
const defaultStats: Stat[] = [
|
||||
{ label: "Uptime", value: "99.98%", hint: "30d" },
|
||||
{ label: "Latency", value: "84ms", hint: "p95" },
|
||||
{ label: "Migrations", value: "12", hint: "this week" },
|
||||
];
|
||||
|
||||
export function DesignPanel({
|
||||
title = "System Brief",
|
||||
subtitle = "A compact panel designed for strong hierarchy and quick scanning.",
|
||||
stats = defaultStats,
|
||||
ctaLabel = "View details",
|
||||
}: {
|
||||
title?: string;
|
||||
subtitle?: string;
|
||||
stats?: Stat[];
|
||||
ctaLabel?: string;
|
||||
}) {
|
||||
return (
|
||||
<section className={styles.shell} aria-label={title}>
|
||||
<div className={styles.head}>
|
||||
<div className={styles.kicker}>Field Report</div>
|
||||
<h2 className={styles.title}>{title}</h2>
|
||||
<p className={styles.subtitle}>{subtitle}</p>
|
||||
</div>
|
||||
|
||||
<div className={styles.grid} role="list">
|
||||
{stats.map((s) => (
|
||||
<article key={s.label} className={styles.card} role="listitem">
|
||||
<div className={styles.cardTop}>
|
||||
<div className={styles.cardLabel}>{s.label}</div>
|
||||
{s.hint ? <div className={styles.cardHint}>{s.hint}</div> : null}
|
||||
</div>
|
||||
<div className={styles.cardValue}>{s.value}</div>
|
||||
</article>
|
||||
))}
|
||||
</div>
|
||||
|
||||
<div className={styles.foot}>
|
||||
<button className={styles.cta} type="button">
|
||||
<span className={styles.ctaText}>{ctaLabel}</span>
|
||||
<span className={styles.ctaIcon} aria-hidden="true">
|
||||
→
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
+131
@@ -0,0 +1,131 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Avant Studio</title>
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:wght@500;700&family=Newsreader:opsz,wght@6..72,400;600&display=swap" rel="stylesheet">
|
||||
<link rel="stylesheet" href="./style.css" />
|
||||
</head>
|
||||
<body>
|
||||
<a class="skip-link" href="#main">Skip to content</a>
|
||||
<div class="grain"></div>
|
||||
<header class="top-bar">
|
||||
<div class="logo">Avant Studio</div>
|
||||
<nav>
|
||||
<a href="#main">Work</a>
|
||||
<a href="#process">Process</a>
|
||||
<a href="#contact">Contact</a>
|
||||
</nav>
|
||||
<button class="cta">Start a project</button>
|
||||
</header>
|
||||
|
||||
<main id="main">
|
||||
<section class="hero">
|
||||
<div class="hero-copy">
|
||||
<p class="eyebrow">Design lab</p>
|
||||
<h1>Striking, production-ready frontends without the generic glaze.</h1>
|
||||
<p class="lede">We craft visceral digital spaces that move fast, feel tactile, and stay memorable. Built with intent, tuned for launch.</p>
|
||||
<div class="actions">
|
||||
<button class="cta primary">See capabilities</button>
|
||||
<button class="ghost">View a live concept</button>
|
||||
</div>
|
||||
<div class="stats">
|
||||
<div><span>42</span> shipped sites</div>
|
||||
<div><span>95%</span> lighthouse perf</div>
|
||||
<div><span>0</span> generic templates</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hero-card reveal">
|
||||
<div class="tag">Now launching</div>
|
||||
<div class="card-body">
|
||||
<h2>Neon Observatory</h2>
|
||||
<p>A retro-futurist control room with live telemetry, aurora gradients, and glitch hover states.</p>
|
||||
<div class="pill">CSS Grid</div>
|
||||
<div class="pill">Framer Motion</div>
|
||||
<div class="pill">ARIA-first</div>
|
||||
<div class="line"></div>
|
||||
<div class="meta">
|
||||
<span>ETA: 2 weeks</span>
|
||||
<span>Visual QA locked</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="grid" id="process">
|
||||
<article class="panel reveal">
|
||||
<p class="eyebrow">01 / Intent</p>
|
||||
<h3>Pick a bold narrative, define the signature move, lock the palette.</h3>
|
||||
<p>We interrogate purpose, audience, and constraints. Each build commits to one unmistakable gesture—stripe, glow, or grain—and sticks to it.</p>
|
||||
</article>
|
||||
<article class="panel reveal">
|
||||
<p class="eyebrow">02 / Build</p>
|
||||
<h3>Real code: semantic HTML, layered CSS, purposeful motion.</h3>
|
||||
<p>CSS variables for theming, responsive grids, progressive enhancement. Animations gated by prefers-reduced-motion.</p>
|
||||
</article>
|
||||
<article class="panel reveal">
|
||||
<p class="eyebrow">03 / Polish</p>
|
||||
<h3>Accessibility, performance, and tactile interactions.</h3>
|
||||
<p>Contrast checks, keyboard navigation, tuned shadows, intentional hover states. We avoid boilerplate aesthetics at all costs.</p>
|
||||
</article>
|
||||
</section>
|
||||
|
||||
<section class="timeline" id="contact">
|
||||
<div class="timeline-head">
|
||||
<p class="eyebrow">Field notes</p>
|
||||
<h3>Recent drops</h3>
|
||||
</div>
|
||||
<div class="timeline-rail">
|
||||
<div class="dot"></div>
|
||||
<div class="dot"></div>
|
||||
<div class="dot"></div>
|
||||
</div>
|
||||
<div class="timeline-items">
|
||||
<div class="timeline-card reveal">
|
||||
<p class="label">2024</p>
|
||||
<h4>Aerial atlas</h4>
|
||||
<p>Editorial map portal with split-screen narrative and scroll-synced chapters.</p>
|
||||
</div>
|
||||
<div class="timeline-card reveal">
|
||||
<p class="label">2023</p>
|
||||
<h4>Glassfoundry</h4>
|
||||
<p>Industrial dashboard with translucent panels, border glows, and live system vitals.</p>
|
||||
</div>
|
||||
<div class="timeline-card reveal">
|
||||
<p class="label">2022</p>
|
||||
<h4>Islands</h4>
|
||||
<p>Pastel travel companion with hand-drawn dividers, slow float animations, and tactile cards.</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
|
||||
<footer class="footer">
|
||||
<div class="marquee" aria-hidden="true">
|
||||
<span>Distinctive frontends · Real code · No generic glaze · </span>
|
||||
<span>Distinctive frontends · Real code · No generic glaze · </span>
|
||||
<span>Distinctive frontends · Real code · No generic glaze · </span>
|
||||
</div>
|
||||
<div class="footer-grid">
|
||||
<div>
|
||||
<p class="eyebrow">Contact</p>
|
||||
<a href="mailto:hello@avant.studio">hello@avant.studio</a>
|
||||
</div>
|
||||
<div>
|
||||
<p class="eyebrow">Social</p>
|
||||
<a href="#">Are.na</a>
|
||||
<a href="#">Behance</a>
|
||||
</div>
|
||||
<div>
|
||||
<p class="eyebrow">Collab</p>
|
||||
<p>We ship components, pages, systems, and microsites.</p>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<script src="./script.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,13 @@
|
||||
const observer = new IntersectionObserver(
|
||||
entries => {
|
||||
entries.forEach(entry => {
|
||||
if (entry.isIntersecting) {
|
||||
entry.target.classList.add('visible');
|
||||
observer.unobserve(entry.target);
|
||||
}
|
||||
});
|
||||
},
|
||||
{ threshold: 0.2 }
|
||||
);
|
||||
|
||||
document.querySelectorAll('.reveal').forEach(el => observer.observe(el));
|
||||
@@ -0,0 +1,425 @@
|
||||
@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:wght@500;700&family=Newsreader:opsz,wght@6..72,400;600&display=swap');
|
||||
|
||||
:root {
|
||||
--bg: #0b0c10;
|
||||
--fg: #f6f1e6;
|
||||
--muted: #a7acba;
|
||||
--accent: #ff6b4a;
|
||||
--accent-2: #6b9bff;
|
||||
--card: rgba(255, 255, 255, 0.03);
|
||||
--stroke: rgba(255, 255, 255, 0.12);
|
||||
--radius: 18px;
|
||||
--shadow: 0 18px 44px rgba(0, 0, 0, 0.35);
|
||||
--ease: cubic-bezier(0.22, 1, 0.36, 1);
|
||||
}
|
||||
|
||||
*,
|
||||
*::before,
|
||||
*::after {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
font-family: 'Newsreader', 'Times New Roman', serif;
|
||||
color: var(--fg);
|
||||
background: var(--bg);
|
||||
min-height: 100vh;
|
||||
line-height: 1.7;
|
||||
text-rendering: optimizeLegibility;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
background-image:
|
||||
radial-gradient(1200px at 15% 20%, rgba(107, 155, 255, 0.25), transparent 50%),
|
||||
radial-gradient(1400px at 80% 0%, rgba(255, 107, 74, 0.2), transparent 50%),
|
||||
linear-gradient(135deg, rgba(255, 255, 255, 0.03), transparent);
|
||||
}
|
||||
|
||||
.grain {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
pointer-events: none;
|
||||
background:
|
||||
radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.04), transparent 35%),
|
||||
repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.02) 1px, transparent 1px, transparent 3px);
|
||||
mix-blend-mode: soft-light;
|
||||
opacity: 0.7;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
a {
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.skip-link {
|
||||
position: absolute;
|
||||
left: -999px;
|
||||
top: 0;
|
||||
padding: 12px 16px;
|
||||
background: var(--accent);
|
||||
color: #0b0c10;
|
||||
border-radius: 8px;
|
||||
font-weight: 700;
|
||||
z-index: 999;
|
||||
}
|
||||
|
||||
.skip-link:focus {
|
||||
left: 16px;
|
||||
top: 16px;
|
||||
}
|
||||
|
||||
.top-bar {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 10;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 18px 36px;
|
||||
backdrop-filter: blur(10px);
|
||||
background: rgba(11, 12, 16, 0.75);
|
||||
border-bottom: 1px solid var(--stroke);
|
||||
}
|
||||
|
||||
.logo {
|
||||
font-family: 'Bricolage Grotesque', 'Arial Black', sans-serif;
|
||||
font-weight: 700;
|
||||
letter-spacing: -0.02em;
|
||||
}
|
||||
|
||||
nav {
|
||||
display: flex;
|
||||
gap: 18px;
|
||||
font-size: 0.95rem;
|
||||
}
|
||||
|
||||
nav a {
|
||||
padding: 8px 12px;
|
||||
border-radius: 999px;
|
||||
border: 1px solid transparent;
|
||||
transition: border-color 220ms var(--ease), color 220ms var(--ease);
|
||||
}
|
||||
|
||||
nav a:hover,
|
||||
nav a:focus-visible {
|
||||
border-color: var(--stroke);
|
||||
color: var(--accent);
|
||||
}
|
||||
|
||||
button {
|
||||
font-family: 'Bricolage Grotesque', sans-serif;
|
||||
font-weight: 700;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.cta {
|
||||
padding: 12px 18px;
|
||||
border-radius: 999px;
|
||||
background: linear-gradient(120deg, var(--accent), var(--accent-2));
|
||||
color: #0b0c10;
|
||||
box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
|
||||
transition: transform 200ms var(--ease), box-shadow 200ms var(--ease);
|
||||
}
|
||||
|
||||
.cta:hover {
|
||||
transform: translateY(-3px);
|
||||
box-shadow: 0 16px 44px rgba(0, 0, 0, 0.35);
|
||||
}
|
||||
|
||||
.hero {
|
||||
display: grid;
|
||||
grid-template-columns: 1.2fr 0.8fr;
|
||||
gap: 32px;
|
||||
padding: 96px 36px 48px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.hero-copy h1 {
|
||||
font-family: 'Bricolage Grotesque', sans-serif;
|
||||
font-size: clamp(2.4rem, 5vw, 3.6rem);
|
||||
line-height: 1.1;
|
||||
letter-spacing: -0.03em;
|
||||
margin: 12px 0;
|
||||
}
|
||||
|
||||
.hero .lede {
|
||||
max-width: 56ch;
|
||||
color: var(--muted);
|
||||
font-size: 1.05rem;
|
||||
}
|
||||
|
||||
.eyebrow {
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.18em;
|
||||
font-size: 0.78rem;
|
||||
color: var(--accent);
|
||||
margin: 0 0 8px;
|
||||
}
|
||||
|
||||
.actions {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
margin: 24px 0 18px;
|
||||
}
|
||||
|
||||
.ghost {
|
||||
padding: 12px 16px;
|
||||
border-radius: 999px;
|
||||
background: transparent;
|
||||
border: 1.5px solid var(--stroke);
|
||||
color: var(--fg);
|
||||
transition: border-color 220ms var(--ease), color 220ms var(--ease), transform 220ms var(--ease);
|
||||
}
|
||||
|
||||
.ghost:hover {
|
||||
border-color: var(--accent);
|
||||
color: var(--accent);
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
|
||||
.stats {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
|
||||
gap: 12px;
|
||||
margin-top: 20px;
|
||||
color: var(--muted);
|
||||
font-size: 0.95rem;
|
||||
}
|
||||
|
||||
.stats span {
|
||||
display: block;
|
||||
font-family: 'Bricolage Grotesque', sans-serif;
|
||||
font-size: 1.5rem;
|
||||
color: var(--fg);
|
||||
}
|
||||
|
||||
.hero-card {
|
||||
background: var(--card);
|
||||
border: 1px solid var(--stroke);
|
||||
border-radius: 22px;
|
||||
padding: 24px;
|
||||
box-shadow: var(--shadow);
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.hero-card::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
inset: -30%;
|
||||
background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.04), transparent 45%);
|
||||
transform: rotate(8deg);
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
.hero-card .tag {
|
||||
display: inline-block;
|
||||
padding: 8px 12px;
|
||||
border-radius: 999px;
|
||||
background: rgba(255, 255, 255, 0.07);
|
||||
color: var(--accent);
|
||||
font-size: 0.85rem;
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.hero-card .card-body {
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.hero-card h2 {
|
||||
font-family: 'Bricolage Grotesque', sans-serif;
|
||||
margin: 12px 0 8px;
|
||||
}
|
||||
|
||||
.hero-card p {
|
||||
color: var(--muted);
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.pill {
|
||||
display: inline-block;
|
||||
padding: 8px 12px;
|
||||
border-radius: 999px;
|
||||
background: rgba(255, 255, 255, 0.05);
|
||||
border: 1px solid var(--stroke);
|
||||
margin: 4px 6px 4px 0;
|
||||
font-size: 0.85rem;
|
||||
}
|
||||
|
||||
.line {
|
||||
margin: 16px 0;
|
||||
height: 1px;
|
||||
background: linear-gradient(90deg, transparent, var(--accent), transparent);
|
||||
}
|
||||
|
||||
.meta {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
color: var(--muted);
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
.grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
|
||||
gap: 18px;
|
||||
padding: 48px 36px;
|
||||
}
|
||||
|
||||
.panel {
|
||||
border: 1px solid var(--stroke);
|
||||
border-radius: var(--radius);
|
||||
padding: 22px;
|
||||
background: rgba(255, 255, 255, 0.02);
|
||||
box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
|
||||
}
|
||||
|
||||
.panel h3 {
|
||||
margin: 6px 0 10px;
|
||||
font-family: 'Bricolage Grotesque', sans-serif;
|
||||
}
|
||||
|
||||
.panel p {
|
||||
color: var(--muted);
|
||||
}
|
||||
|
||||
.timeline {
|
||||
padding: 24px 36px 80px;
|
||||
border-top: 1px solid var(--stroke);
|
||||
}
|
||||
|
||||
.timeline-head h3 {
|
||||
font-family: 'Bricolage Grotesque', sans-serif;
|
||||
margin: 8px 0 16px;
|
||||
}
|
||||
|
||||
.timeline-rail {
|
||||
position: relative;
|
||||
height: 3px;
|
||||
background: var(--stroke);
|
||||
border-radius: 999px;
|
||||
margin: 24px 0 32px;
|
||||
}
|
||||
|
||||
.timeline-rail .dot {
|
||||
position: absolute;
|
||||
top: -6px;
|
||||
width: 15px;
|
||||
height: 15px;
|
||||
background: var(--accent);
|
||||
border-radius: 50%;
|
||||
box-shadow: 0 0 0 6px rgba(255, 107, 74, 0.15);
|
||||
}
|
||||
|
||||
.timeline-rail .dot:nth-child(1) { left: 8%; }
|
||||
.timeline-rail .dot:nth-child(2) { left: 50%; }
|
||||
.timeline-rail .dot:nth-child(3) { left: 88%; }
|
||||
|
||||
.timeline-items {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
.timeline-card {
|
||||
border: 1px solid var(--stroke);
|
||||
border-radius: var(--radius);
|
||||
padding: 18px;
|
||||
background: rgba(255, 255, 255, 0.02);
|
||||
box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
|
||||
.timeline-card .label {
|
||||
font-size: 0.9rem;
|
||||
letter-spacing: 0.12em;
|
||||
color: var(--accent);
|
||||
text-transform: uppercase;
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
|
||||
.timeline-card h4 {
|
||||
margin: 4px 0 8px;
|
||||
font-family: 'Bricolage Grotesque', sans-serif;
|
||||
}
|
||||
|
||||
.timeline-card p {
|
||||
color: var(--muted);
|
||||
}
|
||||
|
||||
.footer {
|
||||
border-top: 1px solid var(--stroke);
|
||||
padding: 28px 36px 48px;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.marquee {
|
||||
display: grid;
|
||||
grid-auto-flow: column;
|
||||
gap: 16px;
|
||||
font-family: 'Bricolage Grotesque', sans-serif;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.14em;
|
||||
color: var(--muted);
|
||||
animation: scroll 18s linear infinite;
|
||||
}
|
||||
|
||||
@keyframes scroll {
|
||||
from { transform: translateX(0); }
|
||||
to { transform: translateX(-50%); }
|
||||
}
|
||||
|
||||
.footer-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
|
||||
gap: 12px;
|
||||
margin-top: 24px;
|
||||
}
|
||||
|
||||
.footer-grid a {
|
||||
display: block;
|
||||
color: var(--fg);
|
||||
text-decoration: underline;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.reveal {
|
||||
opacity: 0;
|
||||
transform: translateY(22px);
|
||||
transition: transform 320ms var(--ease), opacity 320ms var(--ease);
|
||||
}
|
||||
|
||||
.reveal.visible {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
}
|
||||
|
||||
@media (max-width: 960px) {
|
||||
.hero {
|
||||
grid-template-columns: 1fr;
|
||||
padding-top: 72px;
|
||||
}
|
||||
|
||||
.top-bar {
|
||||
position: sticky;
|
||||
}
|
||||
|
||||
nav {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.actions {
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
}
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
* {
|
||||
animation: none !important;
|
||||
transition: none !important;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
# Aesthetic Playbook
|
||||
|
||||
Pick ONE direction and commit. Swap colors/fonts if needed, but keep the intent. Choose a single **signature move** that someone will remember.
|
||||
|
||||
## Font Rule (avoid default vibes)
|
||||
- If the repo already has a font system, stay consistent unless asked to change it.
|
||||
- Otherwise: pick a characterful display font + a legible body font. Avoid overused “default tech” pairings.
|
||||
|
||||
## Brutalist Raw (high-contrast, rule-heavy)
|
||||
- Fonts: Display `Bricolage Grotesque` / `Fraunces`; Body `Atkinson Hyperlegible` / `IBM Plex Sans`; Mono `IBM Plex Mono`.
|
||||
- Colors: Ink/ivory with one acidic accent (e.g. tomato, chartreuse).
|
||||
- Signature moves: oversized numeric index badges; thick 2px rules; hard invert hover.
|
||||
- Backgrounds: checkerboard corner, dotted matrix, a single diagonal stripe.
|
||||
|
||||
## Editorial / Magazine (luxury, typographic hierarchy)
|
||||
- Fonts: Display `Instrument Serif` / `Cormorant Garamond`; Body `Source Serif 4` / `Newsreader`; Mono `DM Mono`.
|
||||
- Colors: warm off-white, deep ink, one burnt accent (rust/saffron).
|
||||
- Signature moves: pull-quote rail; hairline rules; “issue number” metadata strip.
|
||||
- Backgrounds: subtle paper grain, soft vignette.
|
||||
|
||||
## Techno-Gothic (dark, minimal, sharp accents)
|
||||
- Fonts: Display `Unbounded` / `Syne`; Body `Work Sans` / `Barlow`; Mono `JetBrains Mono`.
|
||||
- Colors: near-black base with cold accent (cyan/acid green) + muted steel.
|
||||
- Signature moves: corner ticks, scanline sheen on hover, “system status” chips.
|
||||
- Backgrounds: diagonal hatch, faint grid, tiny starfield.
|
||||
|
||||
## Neo-Poster (bold blocks, loud hierarchy)
|
||||
- Fonts: Display `Bebas Neue` / `Archivo Black`; Body `Noto Sans`; Mono `Space Mono` (only if it fits the concept).
|
||||
- Colors: high-sat primaries on warm neutral, with black rules.
|
||||
- Signature moves: torn-paper edge (CSS mask vibe); huge headline with tight tracking; sticker CTA.
|
||||
- Backgrounds: halftone dot field, off-register shadows.
|
||||
|
||||
## Soft Craft (warm, tactile, friendly)
|
||||
- Fonts: Display `Sora` / `Epilogue`; Body `Alegreya Sans` / `Manrope`; Mono optional.
|
||||
- Colors: warm cream, terracotta accent, sage secondary.
|
||||
- Signature moves: stitched borders; stacked cards; gentle floating blobs (reduced-motion safe).
|
||||
- Backgrounds: irregular gradient blobs + low-opacity noise.
|
||||
|
||||
## Industrial / Utilitarian (labeled panels, measured density)
|
||||
- Fonts: Display `Archivo` / `Anton`; Body `Barlow` / `IBM Plex Sans`; Mono `JetBrains Mono`.
|
||||
- Colors: cold neutrals with hazard accent (amber) and a secondary teal.
|
||||
- Signature moves: panel labels; coordinate tags; “spec table” sectioning.
|
||||
- Backgrounds: repeating hatch, soft inner glows for depth.
|
||||
|
||||
## How to Choose (fast)
|
||||
1) Choose the emotional goal (luxe, raw, calm, severe, playful).
|
||||
2) Pick type first (display sets the tone).
|
||||
3) Pick one signature move and apply it in 2–3 places max.
|
||||
4) Keep everything else quiet and supportive.
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
# AI-native UI Patterns (trust + control)
|
||||
|
||||
AI UI should feel like a product feature, not a bolt-on chatbot. Prioritize clarity, trust, and user control.
|
||||
|
||||
## Core patterns
|
||||
|
||||
### Copilot side panel (assistive AI)
|
||||
- Persistent panel (often right rail) with:
|
||||
- header + **AI disclosure**
|
||||
- prompt input (or command chips/templates)
|
||||
- output stream area
|
||||
- actions (apply, copy, discard)
|
||||
|
||||
### AI-generated labeling (strict)
|
||||
- AI output must not be visually confused with user-authored content.
|
||||
- Use a badge/label (“AI-generated”) with tooltip text and/or subtle tinting.
|
||||
|
||||
### Citations / sources (recommended for factual outputs)
|
||||
- Render as chips or footnotes under the relevant block.
|
||||
- Make them clickable and scannable (title + optional section anchor).
|
||||
|
||||
### “Why this?” affordance
|
||||
- Provide a short “why this suggestion?” expansion with neutral language.
|
||||
- Prefer concrete reasons (policy, data, heuristic) over anthropomorphic phrasing.
|
||||
|
||||
## Human-in-the-loop (strict)
|
||||
- Provide at least one of:
|
||||
- **Apply / Undo**
|
||||
- **Accept / Reject**
|
||||
- confirmation for destructive actions
|
||||
- Never silently perform irreversible changes.
|
||||
|
||||
## AI loading and motion
|
||||
- Use subtle, purposeful indicators:
|
||||
- typing dots, shimmer skeleton, progressive reveal
|
||||
- Respect `prefers-reduced-motion` (no endless animated flourish).
|
||||
|
||||
## Signature move ideas (pick one)
|
||||
- Citation rail (chips aligned to the right edge of the answer)
|
||||
- Apply stack (queued changes with an “apply all” + per-item undo)
|
||||
- Confidence capsule (uncertainty/assumptions shown as compact pills)
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
# Anti-Patterns (avoid “AI slop”)
|
||||
|
||||
Use this as a quick filter before shipping.
|
||||
|
||||
## Visual clichés
|
||||
- Generic purple-on-white gradients with soft glass cards everywhere.
|
||||
- Samey startup landing layout: centered hero, 3 cards, logo wall, FAQ, identical CTA band.
|
||||
- Indiscriminate glow + blur layers that reduce legibility.
|
||||
|
||||
## Typography defaults
|
||||
- Unintentional type: no scale, no rhythm, headings too close in size to body.
|
||||
- Mixing too many fonts “because it looks cool” (unless the direction is explicitly chaotic).
|
||||
- Defaulting to the same trendy “safe” font pairings (e.g., the usual modern grotesks) when the project calls for a stronger voice.
|
||||
|
||||
## Motion mistakes
|
||||
- Random micro-animations everywhere instead of one orchestrated sequence.
|
||||
- No `prefers-reduced-motion` handling.
|
||||
- Hover-only affordances (mobile users get nothing).
|
||||
|
||||
## UX/a11y misses
|
||||
- Weak focus states, low contrast, tiny hit targets.
|
||||
- Buttons styled as links (or vice versa) without correct semantics.
|
||||
- Missing labels on inputs, icon-only actions without accessible names.
|
||||
+56
@@ -0,0 +1,56 @@
|
||||
# Implementation Patterns
|
||||
|
||||
Use these patterns to move quickly while keeping the aesthetic sharp. Prefer real code and real semantics over “design vibes”.
|
||||
|
||||
## Decision: Vanilla vs React
|
||||
- Use **vanilla** for quick concepts, single pages, marketing-style layouts.
|
||||
- Use **React** when the UI lives inside an app, needs state, routes, or reusable components.
|
||||
|
||||
## Vanilla HTML/CSS/JS Workflow
|
||||
- Start with semantic structure: `header`, `main`, `section`, `article`, `footer`.
|
||||
- Add skip links when there’s a nav/header: `a.skip-nav` → `#main`.
|
||||
- Define theme tokens up top:
|
||||
```css
|
||||
:root {
|
||||
--bg: #0b0c10;
|
||||
--surface: #10131a;
|
||||
--fg: #f7f2e9;
|
||||
--muted: #9aa1b5;
|
||||
--accent: #ff6b4a;
|
||||
--radius: 18px;
|
||||
--shadow: 0 18px 40px rgba(0,0,0,0.35);
|
||||
--ease: cubic-bezier(.2,.9,.2,1);
|
||||
}
|
||||
```
|
||||
- Layout: Grid for macro, Flexbox for clusters. Break the grid deliberately but preserve reading order.
|
||||
- Motion: prefer CSS keyframes + `transition`. Orchestrate a few moments (load + hover), not everything.
|
||||
- Reveal animations: use IntersectionObserver to toggle classes (small JS only).
|
||||
|
||||
## React Patterns (TypeScript)
|
||||
- Keep components small: `Hero`, `FeatureList`, `SpecsRail`, `CTA`.
|
||||
- Use data arrays for repeated UI (cards/steps/metrics) and map to components.
|
||||
- Styling: prefer the repo’s existing approach. If unknown, CSS Modules is a safe default.
|
||||
- Motion: keep durations < 500ms; stagger by 80–140ms; gate everything with reduced-motion.
|
||||
|
||||
## Motion & Reduced Motion
|
||||
- Always include a reduced-motion fallback:
|
||||
```css
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
* { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
|
||||
}
|
||||
```
|
||||
- Keep animations paint-friendly (transform/opacity). Avoid animating large blur shadows.
|
||||
|
||||
## Layout & Spacing
|
||||
- Use a spacing scale (4/8 base). Keep prose line-length ~68–76ch.
|
||||
- If maximalist: constrain chaos inside frames. If minimal: increase margins and tighten hierarchy.
|
||||
|
||||
## Texture & Backgrounds (CSS-only)
|
||||
- Use layered gradients and subtle noise-like patterns (no heavy assets by default).
|
||||
- Prefer subtle grain overlays over full-page blur.
|
||||
|
||||
## QA Checklist
|
||||
- One `h1`, logical heading order, landmarks present.
|
||||
- Focus visible, keyboard usable, contrast AA+.
|
||||
- Tap targets 44px minimum for primary interactions.
|
||||
- Mobile layout feels intentional (not just “stack everything”).
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
# React + Next.js Best Practices (concise)
|
||||
|
||||
## React component design
|
||||
- Keep components and Hooks pure: compute UI from props/state without side effects in render.
|
||||
- Run side effects outside render (event handlers or Effects).
|
||||
- Prefer event handlers for user-driven work; avoid “Effect for everything.”
|
||||
- Follow the Rules of Hooks (top-level only; consistent call order; only in React functions).
|
||||
- Don’t call component functions directly; use JSX so React controls rendering.
|
||||
- Split large components into small, focused pieces; keep props stable and typed.
|
||||
|
||||
## Next.js App Router
|
||||
- Server Components by default; add `"use client"` only when you need state, effects, or browser APIs.
|
||||
- Keep Client Components small and isolated (UI islands).
|
||||
- Use `next/link` for navigation and `next/image` for real images.
|
||||
- Prefer `next/font` when changing typography to avoid layout shift/FOIT.
|
||||
|
||||
## Data fetching and caching
|
||||
- Prefer server-side `fetch` and explicit caching with `cache`/`revalidate`.
|
||||
- Avoid client-side fetch inside `useEffect` unless you truly need client-only data.
|
||||
- Keep loading/error states explicit and user-friendly.
|
||||
|
||||
## State and performance
|
||||
- Minimize global state; lift only when necessary.
|
||||
- Memoize expensive calculations; keep derived state computed, not stored.
|
||||
- Avoid unnecessary re-renders by splitting components and using stable props.
|
||||
@@ -0,0 +1,138 @@
|
||||
---
|
||||
name: skill-vetter
|
||||
version: 1.0.0
|
||||
description: Security-first skill vetting for AI agents. Use before installing any skill from ClawdHub, GitHub, or other sources. Checks for red flags, permission scope, and suspicious patterns.
|
||||
---
|
||||
|
||||
# Skill Vetter 🔒
|
||||
|
||||
Security-first vetting protocol for AI agent skills. **Never install a skill without vetting it first.**
|
||||
|
||||
## When to Use
|
||||
|
||||
- Before installing any skill from ClawdHub
|
||||
- Before running skills from GitHub repos
|
||||
- When evaluating skills shared by other agents
|
||||
- Anytime you're asked to install unknown code
|
||||
|
||||
## Vetting Protocol
|
||||
|
||||
### Step 1: Source Check
|
||||
|
||||
```
|
||||
Questions to answer:
|
||||
- [ ] Where did this skill come from?
|
||||
- [ ] Is the author known/reputable?
|
||||
- [ ] How many downloads/stars does it have?
|
||||
- [ ] When was it last updated?
|
||||
- [ ] Are there reviews from other agents?
|
||||
```
|
||||
|
||||
### Step 2: Code Review (MANDATORY)
|
||||
|
||||
Read ALL files in the skill. Check for these **RED FLAGS**:
|
||||
|
||||
```
|
||||
🚨 REJECT IMMEDIATELY IF YOU SEE:
|
||||
─────────────────────────────────────────
|
||||
• curl/wget to unknown URLs
|
||||
• Sends data to external servers
|
||||
• Requests credentials/tokens/API keys
|
||||
• Reads ~/.ssh, ~/.aws, ~/.config without clear reason
|
||||
• Accesses MEMORY.md, USER.md, SOUL.md, IDENTITY.md
|
||||
• Uses base64 decode on anything
|
||||
• Uses eval() or exec() with external input
|
||||
• Modifies system files outside workspace
|
||||
• Installs packages without listing them
|
||||
• Network calls to IPs instead of domains
|
||||
• Obfuscated code (compressed, encoded, minified)
|
||||
• Requests elevated/sudo permissions
|
||||
• Accesses browser cookies/sessions
|
||||
• Touches credential files
|
||||
─────────────────────────────────────────
|
||||
```
|
||||
|
||||
### Step 3: Permission Scope
|
||||
|
||||
```
|
||||
Evaluate:
|
||||
- [ ] What files does it need to read?
|
||||
- [ ] What files does it need to write?
|
||||
- [ ] What commands does it run?
|
||||
- [ ] Does it need network access? To where?
|
||||
- [ ] Is the scope minimal for its stated purpose?
|
||||
```
|
||||
|
||||
### Step 4: Risk Classification
|
||||
|
||||
| Risk Level | Examples | Action |
|
||||
|------------|----------|--------|
|
||||
| 🟢 LOW | Notes, weather, formatting | Basic review, install OK |
|
||||
| 🟡 MEDIUM | File ops, browser, APIs | Full code review required |
|
||||
| 🔴 HIGH | Credentials, trading, system | Human approval required |
|
||||
| ⛔ EXTREME | Security configs, root access | Do NOT install |
|
||||
|
||||
## Output Format
|
||||
|
||||
After vetting, produce this report:
|
||||
|
||||
```
|
||||
SKILL VETTING REPORT
|
||||
═══════════════════════════════════════
|
||||
Skill: [name]
|
||||
Source: [ClawdHub / GitHub / other]
|
||||
Author: [username]
|
||||
Version: [version]
|
||||
───────────────────────────────────────
|
||||
METRICS:
|
||||
• Downloads/Stars: [count]
|
||||
• Last Updated: [date]
|
||||
• Files Reviewed: [count]
|
||||
───────────────────────────────────────
|
||||
RED FLAGS: [None / List them]
|
||||
|
||||
PERMISSIONS NEEDED:
|
||||
• Files: [list or "None"]
|
||||
• Network: [list or "None"]
|
||||
• Commands: [list or "None"]
|
||||
───────────────────────────────────────
|
||||
RISK LEVEL: [🟢 LOW / 🟡 MEDIUM / 🔴 HIGH / ⛔ EXTREME]
|
||||
|
||||
VERDICT: [✅ SAFE TO INSTALL / ⚠️ INSTALL WITH CAUTION / ❌ DO NOT INSTALL]
|
||||
|
||||
NOTES: [Any observations]
|
||||
═══════════════════════════════════════
|
||||
```
|
||||
|
||||
## Quick Vet Commands
|
||||
|
||||
For GitHub-hosted skills:
|
||||
```bash
|
||||
# Check repo stats
|
||||
curl -s "https://api.github.com/repos/OWNER/REPO" | jq '{stars: .stargazers_count, forks: .forks_count, updated: .updated_at}'
|
||||
|
||||
# List skill files
|
||||
curl -s "https://api.github.com/repos/OWNER/REPO/contents/skills/SKILL_NAME" | jq '.[].name'
|
||||
|
||||
# Fetch and review SKILL.md
|
||||
curl -s "https://raw.githubusercontent.com/OWNER/REPO/main/skills/SKILL_NAME/SKILL.md"
|
||||
```
|
||||
|
||||
## Trust Hierarchy
|
||||
|
||||
1. **Official OpenClaw skills** → Lower scrutiny (still review)
|
||||
2. **High-star repos (1000+)** → Moderate scrutiny
|
||||
3. **Known authors** → Moderate scrutiny
|
||||
4. **New/unknown sources** → Maximum scrutiny
|
||||
5. **Skills requesting credentials** → Human approval always
|
||||
|
||||
## Remember
|
||||
|
||||
- No skill is worth compromising security
|
||||
- When in doubt, don't install
|
||||
- Ask your human for high-risk decisions
|
||||
- Document what you vet for future reference
|
||||
|
||||
---
|
||||
|
||||
*Paranoia is a feature.* 🔒🦀
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"owner": "spclaudehome",
|
||||
"slug": "skill-vetter",
|
||||
"displayName": "Skill Vetter",
|
||||
"latest": {
|
||||
"version": "1.0.0",
|
||||
"publishedAt": 1769863429632,
|
||||
"commit": "https://github.com/clawdbot/skills/commit/c563399ea973b60cb63db5ed84e871750e65939a"
|
||||
},
|
||||
"history": []
|
||||
}
|
||||
@@ -0,0 +1,978 @@
|
||||
---
|
||||
name: superpowers
|
||||
description: >
|
||||
Agentic software development methodology — 13 integrated skills for
|
||||
disciplined AI-assisted development covering brainstorming, planning,
|
||||
TDD, debugging, code review, git worktrees, and branch management.
|
||||
metadata:
|
||||
openclaw:
|
||||
emoji: "⚡"
|
||||
---
|
||||
|
||||
# Superpowers
|
||||
|
||||
Disciplined, systematic approach to AI-assisted software development. 13 integrated skills covering the full development lifecycle.
|
||||
|
||||
## The 7-Step Workflow
|
||||
|
||||
1. **Brainstorm** — Design before implementation (Section 2)
|
||||
2. **Plan** — Write detailed implementation plan (Section 3)
|
||||
3. **Execute** — Implement with subagents or batches (Sections 4-6)
|
||||
4. **Test** — TDD throughout: RED-GREEN-REFACTOR (Section 7)
|
||||
5. **Debug** — Systematic root cause analysis when needed (Section 8)
|
||||
6. **Review** — Code review after each task (Section 10)
|
||||
7. **Finish** — Branch completion and integration (Section 12)
|
||||
|
||||
## How to Use
|
||||
|
||||
Apply the relevant section based on your current task:
|
||||
|
||||
| Task | Section |
|
||||
|------|---------|
|
||||
| Starting new work | Section 2 (Brainstorming) → Section 3 (Writing Plans) |
|
||||
| Implementing a plan (this session) | Section 5 (Subagent-Driven Development) |
|
||||
| Implementing a plan (separate session) | Section 4 (Executing Plans) |
|
||||
| Multiple independent problems | Section 6 (Dispatching Parallel Agents) |
|
||||
| Writing or fixing code | Section 7 (Test-Driven Development) |
|
||||
| Bug, test failure, unexpected behavior | Section 8 (Systematic Debugging) |
|
||||
| About to claim work is done | Section 9 (Verification Before Completion) |
|
||||
| After completing work | Section 10 (Code Review) |
|
||||
| Need isolated workspace | Section 11 (Using Git Worktrees) |
|
||||
| Ready to merge/integrate | Section 12 (Finishing a Development Branch) |
|
||||
| Creating new skills | Section 13 (Writing Skills) |
|
||||
|
||||
**Skill priority:** Process skills first (brainstorming, debugging), then implementation skills.
|
||||
|
||||
**Skill types:**
|
||||
- **Rigid** (TDD, debugging, verification): Follow exactly. Don't adapt away discipline.
|
||||
- **Flexible** (patterns, worktrees): Adapt principles to context.
|
||||
|
||||
---
|
||||
|
||||
## 1. Using Superpowers
|
||||
|
||||
<EXTREMELY-IMPORTANT>
|
||||
If you think there is even a 1% chance a skill might apply to what you are doing, you ABSOLUTELY MUST invoke the skill.
|
||||
|
||||
IF A SKILL APPLIES TO YOUR TASK, YOU DO NOT HAVE A CHOICE. YOU MUST USE IT.
|
||||
|
||||
This is not negotiable. This is not optional. You cannot rationalize your way out of this.
|
||||
</EXTREMELY-IMPORTANT>
|
||||
|
||||
**Rule:** Invoke relevant skills BEFORE any response or action. Even a 1% chance a section might apply means you should check.
|
||||
|
||||
**Process:**
|
||||
1. User message received
|
||||
2. Check: might any section apply?
|
||||
- Yes → Follow that section
|
||||
- No → Respond directly
|
||||
3. If about to plan: check Section 2 (Brainstorming) first
|
||||
4. If section has checklist: create todo per checklist item
|
||||
5. Announce: "Using [skill] to [purpose]"
|
||||
|
||||
**Priority order:**
|
||||
1. Process sections first (brainstorming, debugging)
|
||||
2. Implementation sections second
|
||||
|
||||
**User instructions say WHAT, not HOW.** "Add X" or "Fix Y" doesn't mean skip workflows.
|
||||
|
||||
### Red Flags — You're Rationalizing
|
||||
|
||||
| Thought | Reality |
|
||||
|---------|---------|
|
||||
| "This is just a simple question" | Questions are tasks. Check for skills. |
|
||||
| "I need more context first" | Skill check comes BEFORE clarifying questions. |
|
||||
| "Let me explore the codebase first" | Skills tell you HOW to explore. Check first. |
|
||||
| "I can check git/files quickly" | Files lack conversation context. Check for skills. |
|
||||
| "Let me gather information first" | Skills tell you HOW to gather information. |
|
||||
| "This doesn't need a formal skill" | If a skill exists, use it. |
|
||||
| "I remember this skill" | Skills evolve. Read current version. |
|
||||
| "This doesn't count as a task" | Action = task. Check for skills. |
|
||||
| "The skill is overkill" | Simple things become complex. Use it. |
|
||||
| "I'll just do this one thing first" | Check BEFORE doing anything. |
|
||||
| "This feels productive" | Undisciplined action wastes time. Skills prevent this. |
|
||||
| "I know what that means" | Knowing the concept ≠ using the skill. Invoke it. |
|
||||
|
||||
---
|
||||
|
||||
## 2. Brainstorming
|
||||
|
||||
**Use before:** Any creative work — creating features, building components, adding functionality, or modifying behavior.
|
||||
|
||||
<HARD-GATE>
|
||||
Do NOT write any code, scaffold any project, or take any implementation action until you have presented a design and the user has approved it. This applies to EVERY project regardless of perceived simplicity.
|
||||
</HARD-GATE>
|
||||
|
||||
### Anti-Pattern: "This Is Too Simple To Need A Design"
|
||||
|
||||
Every project goes through this process. A todo list, a single-function utility, a config change — all of them. "Simple" projects are where unexamined assumptions cause the most wasted work. The design can be short (a few sentences for truly simple projects), but you MUST present it and get approval.
|
||||
|
||||
### Checklist
|
||||
|
||||
1. **Explore project context** — check files, docs, recent commits
|
||||
2. **Ask clarifying questions** — one at a time, understand purpose/constraints/success criteria
|
||||
3. **Propose 2-3 approaches** — with trade-offs and your recommendation
|
||||
4. **Present design** — in sections scaled to complexity, get user approval after each section
|
||||
5. **Write design doc** — save to `docs/plans/YYYY-MM-DD-<topic>-design.md` and commit
|
||||
6. **Transition to implementation** — follow Section 3 (Writing Plans)
|
||||
|
||||
### Process
|
||||
|
||||
- Ask one question at a time. Prefer multiple choice.
|
||||
- Propose 2-3 approaches with trade-offs. Lead with your recommendation.
|
||||
- Present design sections incrementally. Get approval after each.
|
||||
- Cover: architecture, components, data flow, error handling, testing.
|
||||
- Apply YAGNI ruthlessly.
|
||||
- Be flexible — go back and clarify when something doesn't make sense.
|
||||
|
||||
### After Design Approval
|
||||
|
||||
Write validated design to `docs/plans/YYYY-MM-DD-<topic>-design.md`, commit, then follow Section 3 (Writing Plans).
|
||||
|
||||
**The terminal state is invoking writing-plans.** Do NOT invoke any other implementation skill. The ONLY next step after brainstorming is writing-plans.
|
||||
|
||||
### Key Principles
|
||||
|
||||
- **One question at a time** — Don't overwhelm with multiple questions
|
||||
- **Multiple choice preferred** — Easier to answer than open-ended when possible
|
||||
- **YAGNI ruthlessly** — Remove unnecessary features from all designs
|
||||
- **Explore alternatives** — Always propose 2-3 approaches before settling
|
||||
- **Incremental validation** — Present design, get approval before moving on
|
||||
|
||||
---
|
||||
|
||||
## 3. Writing Plans
|
||||
|
||||
**Use when:** You have a spec or requirements for a multi-step task, before touching code.
|
||||
|
||||
Write comprehensive implementation plans with bite-sized tasks. Assume the implementer has zero context. Document exact file paths, complete code, exact commands with expected output.
|
||||
|
||||
**Announce at start:** "I'm using the writing-plans skill to create the implementation plan."
|
||||
|
||||
**Save plans to:** `docs/plans/YYYY-MM-DD-<feature-name>.md`
|
||||
|
||||
### Plan Header Template
|
||||
|
||||
Every plan MUST start with:
|
||||
|
||||
# [Feature Name] Implementation Plan
|
||||
> **For agent:** REQUIRED SUB-SKILL: Use Section 4 or Section 5 to implement this plan.
|
||||
**Goal:** [One sentence]
|
||||
**Architecture:** [2-3 sentences]
|
||||
**Tech Stack:** [Key technologies]
|
||||
|
||||
### Task Granularity
|
||||
|
||||
Each step is one action (2-5 minutes):
|
||||
- "Write the failing test" — step
|
||||
- "Run it to verify it fails" — step
|
||||
- "Implement minimal code to pass" — step
|
||||
- "Run tests to verify pass" — step
|
||||
- "Commit" — step
|
||||
|
||||
### Task Structure
|
||||
|
||||
### Task N: [Component Name]
|
||||
**Files:**
|
||||
- Create: `exact/path/to/file.py`
|
||||
- Modify: `exact/path/to/existing.py:123-145`
|
||||
- Test: `tests/exact/path/to/test.py`
|
||||
**Step 1:** Write failing test (with complete code)
|
||||
**Step 2:** Run test, verify fails (exact command + expected output)
|
||||
**Step 3:** Write minimal implementation (complete code)
|
||||
**Step 4:** Run test, verify passes (exact command + expected output)
|
||||
**Step 5:** Commit (exact git commands)
|
||||
|
||||
### Remember
|
||||
|
||||
- Exact file paths always
|
||||
- Complete code in plan (not "add validation")
|
||||
- Exact commands with expected output
|
||||
- DRY, YAGNI, TDD, frequent commits
|
||||
|
||||
### Execution Handoff
|
||||
|
||||
After saving plan, offer:
|
||||
|
||||
**"Plan complete and saved. Two execution options:**
|
||||
|
||||
**1. Subagent-Driven (this session)** — fresh subagent per task, review between tasks, fast iteration → follow Section 5
|
||||
|
||||
**2. Parallel Session (separate)** — open new session, batch execution with checkpoints → follow Section 4
|
||||
|
||||
**Which approach?"**
|
||||
|
||||
---
|
||||
|
||||
## 4. Executing Plans
|
||||
|
||||
**Use when:** You have a written implementation plan to execute in a separate session with review checkpoints.
|
||||
|
||||
**Announce at start:** "I'm using the executing-plans skill to implement this plan."
|
||||
|
||||
### Process
|
||||
|
||||
1. **Load and review plan** — Read critically, raise concerns before starting. If no concerns: create task list and proceed.
|
||||
2. **Execute batch** — Default first 3 tasks. For each: mark in_progress → follow steps exactly → run verifications → mark completed
|
||||
3. **Report** — Show what was implemented, verification output. Say: "Ready for feedback."
|
||||
4. **Continue** — Apply feedback, execute next batch, repeat
|
||||
5. **Complete** — After all tasks verified, follow Section 12 (Finishing a Development Branch)
|
||||
|
||||
### When to Stop and Ask for Help
|
||||
|
||||
**STOP executing immediately when:**
|
||||
- Hit a blocker mid-batch (missing dependency, test fails, instruction unclear)
|
||||
- Plan has critical gaps preventing starting
|
||||
- You don't understand an instruction
|
||||
- Verification fails repeatedly
|
||||
|
||||
**Ask for clarification rather than guessing.**
|
||||
|
||||
### When to Revisit Earlier Steps
|
||||
|
||||
**Return to Review (Step 1) when:**
|
||||
- Partner updates the plan based on your feedback
|
||||
- Fundamental approach needs rethinking
|
||||
|
||||
**Don't force through blockers** — stop and ask.
|
||||
|
||||
### Rules
|
||||
|
||||
- Follow plan steps exactly
|
||||
- Don't skip verifications
|
||||
- Between batches: report and wait
|
||||
- Stop when blocked, don't guess
|
||||
- Never start implementation on main/master without explicit consent
|
||||
|
||||
### Integration
|
||||
|
||||
- REQUIRED: Set up workspace with Section 11 (Git Worktrees) before starting
|
||||
- After all tasks: follow Section 12 (Finishing a Development Branch)
|
||||
|
||||
---
|
||||
|
||||
## 5. Subagent-Driven Development
|
||||
|
||||
**Use when:** Executing implementation plans with independent tasks in the current session. Fresh subagent per task + two-stage review.
|
||||
|
||||
**Core principle:** Fresh subagent per task + two-stage review (spec then quality) = high quality, fast iteration
|
||||
|
||||
### Process
|
||||
|
||||
1. **Read plan, extract all tasks** with full text and context. Create task list.
|
||||
2. **Per task:**
|
||||
a. Dispatch implementer subagent (provide full task text + context, don't make them read plan file)
|
||||
b. If subagent asks questions → answer clearly before proceeding
|
||||
c. Subagent implements, tests, commits, self-reviews
|
||||
d. Dispatch spec reviewer subagent → verify code matches spec
|
||||
e. If issues → implementer fixes → re-review until ✅
|
||||
f. Dispatch code quality reviewer subagent
|
||||
g. If issues → implementer fixes → re-review until ✅
|
||||
h. Mark task complete
|
||||
3. **After all tasks:** Dispatch final code reviewer for entire implementation
|
||||
4. **Complete:** Follow Section 12 (Finishing a Development Branch)
|
||||
|
||||
### Implementer Subagent Prompt
|
||||
|
||||
Provide: full task text, context (where it fits), working directory. Tell them:
|
||||
- Implement exactly what task specifies
|
||||
- Write tests (TDD if task says to)
|
||||
- If you have questions about requirements, approach, or anything unclear — **ask them now before starting**
|
||||
- Commit work
|
||||
- Self-review: completeness (all requirements?), quality (clean, maintainable?), discipline (YAGNI?), testing (real behavior, not mocks?)
|
||||
- If you find issues during self-review, fix them now before reporting
|
||||
- Report: what implemented, test results, files changed, self-review findings, concerns
|
||||
|
||||
### Spec Reviewer Prompt
|
||||
|
||||
Provide: full task requirements, implementer's report. Tell them:
|
||||
- **CRITICAL: Do NOT trust the implementer's report** — read actual code
|
||||
- The implementer may be incomplete, inaccurate, or optimistic
|
||||
- Check by reading code: missing requirements, extra/unneeded work, misunderstandings
|
||||
- Report: ✅ spec compliant or ❌ issues with file:line references
|
||||
|
||||
### Code Quality Reviewer Prompt
|
||||
|
||||
Use code review template (see Section 10). Provide: BASE_SHA, HEAD_SHA, description.
|
||||
- Only dispatch after spec compliance passes
|
||||
- Returns: Strengths, Issues (Critical/Important/Minor), Assessment
|
||||
|
||||
### Rules
|
||||
|
||||
- Never start on main/master without consent
|
||||
- Never skip reviews (spec OR quality)
|
||||
- Spec review BEFORE code quality review
|
||||
- Don't dispatch parallel implementation subagents (conflicts)
|
||||
- Don't move to next task with open review issues
|
||||
- If subagent fails → dispatch fix subagent, don't fix manually (context pollution)
|
||||
- Don't make subagent read plan file (provide full text instead)
|
||||
- Accept "close enough" on spec compliance → NOT acceptable (spec issues = not done)
|
||||
- **Start code quality review before spec compliance is ✅** → WRONG ORDER
|
||||
|
||||
---
|
||||
|
||||
## 6. Dispatching Parallel Agents
|
||||
|
||||
**Use when:** 2+ independent tasks that can be worked on without shared state or sequential dependencies.
|
||||
|
||||
### When to Use
|
||||
|
||||
- 3+ test files failing with different root causes
|
||||
- Multiple subsystems broken independently
|
||||
- Each problem can be understood without context from others
|
||||
- No shared state between investigations
|
||||
|
||||
**Don't use when:**
|
||||
- Failures are related (fix one might fix others)
|
||||
- Need full system context to understand
|
||||
- Agents would interfere (editing same files, shared resources)
|
||||
- Exploratory debugging (you don't know what's broken yet)
|
||||
|
||||
### Pattern
|
||||
|
||||
1. **Identify independent domains** — group failures by what's broken
|
||||
2. **Create focused agent tasks** — each gets: specific scope, clear goal, constraints, expected output format
|
||||
3. **Dispatch in parallel** — one agent per domain
|
||||
4. **Review and integrate** — read summaries, verify no conflicts, run full test suite
|
||||
|
||||
### Agent Prompt Structure
|
||||
|
||||
Good prompts are: focused (one problem domain), self-contained (all context needed), specific about output (what to return).
|
||||
|
||||
- ❌ Too broad: "Fix all the tests" — agent gets lost
|
||||
- ✅ Specific: "Fix agent-tool-abort.test.ts — 3 failures listed below"
|
||||
- ❌ No constraints: agent might refactor everything
|
||||
- ✅ Constrained: "Do NOT change production code" or "Fix tests only"
|
||||
- ❌ Vague output: "Fix it" — you don't know what changed
|
||||
- ✅ Specific: "Return summary of root cause and changes"
|
||||
|
||||
### Real Example
|
||||
|
||||
**Scenario:** 6 test failures across 3 files after major refactoring
|
||||
|
||||
**Dispatch:**
|
||||
- Agent 1 → Fix agent-tool-abort.test.ts (3 timing issues)
|
||||
- Agent 2 → Fix batch-completion-behavior.test.ts (2 event structure bugs)
|
||||
- Agent 3 → Fix tool-approval-race-conditions.test.ts (1 async issue)
|
||||
|
||||
**Results:** All fixes independent, no conflicts, full suite green. 3 problems solved in time of 1.
|
||||
|
||||
---
|
||||
|
||||
## 7. Test-Driven Development
|
||||
|
||||
**Use when:** Implementing any feature or bugfix, before writing implementation code.
|
||||
|
||||
**Core principle:** If you didn't watch the test fail, you don't know if it tests the right thing.
|
||||
|
||||
**Violating the letter of the rules is violating the spirit of the rules.**
|
||||
|
||||
### The Iron Law
|
||||
|
||||
NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST
|
||||
|
||||
Write code before the test? Delete it. Start over. No exceptions:
|
||||
- Don't keep it as "reference"
|
||||
- Don't "adapt" it while writing tests
|
||||
- Don't look at it
|
||||
- Delete means delete
|
||||
|
||||
Implement fresh from tests. Period.
|
||||
|
||||
### RED — Write Failing Test
|
||||
|
||||
Write one minimal test showing what should happen.
|
||||
|
||||
**Good:**
|
||||
```typescript
|
||||
test('retries failed operations 3 times', async () => {
|
||||
let attempts = 0;
|
||||
const operation = () => {
|
||||
attempts++;
|
||||
if (attempts < 3) throw new Error('fail');
|
||||
return 'success';
|
||||
};
|
||||
const result = await retryOperation(operation);
|
||||
expect(result).toBe('success');
|
||||
expect(attempts).toBe(3);
|
||||
});
|
||||
```
|
||||
Clear name, tests real behavior, one thing.
|
||||
|
||||
**Bad:**
|
||||
```typescript
|
||||
test('retry works', async () => {
|
||||
const mock = jest.fn()
|
||||
.mockRejectedValueOnce(new Error())
|
||||
.mockResolvedValueOnce('success');
|
||||
await retryOperation(mock);
|
||||
expect(mock).toHaveBeenCalledTimes(2);
|
||||
});
|
||||
```
|
||||
Vague name, tests mock not code.
|
||||
|
||||
**Requirements:** One behavior. Clear name. Real code (no mocks unless unavoidable).
|
||||
|
||||
### Verify RED
|
||||
|
||||
**MANDATORY. Never skip.**
|
||||
|
||||
Run test. Confirm: fails (not errors), expected failure message, fails because feature missing.
|
||||
|
||||
- Test passes? You're testing existing behavior. Fix test.
|
||||
- Test errors? Fix error, re-run until it fails correctly.
|
||||
|
||||
### GREEN — Minimal Code
|
||||
|
||||
Write simplest code to pass the test. Don't add features, refactor, or "improve" beyond the test.
|
||||
|
||||
**Good:** Just enough to pass.
|
||||
**Bad:** Over-engineered with options/backoff/callbacks the test doesn't require (YAGNI).
|
||||
|
||||
### Verify GREEN
|
||||
|
||||
**MANDATORY.**
|
||||
|
||||
Run test. Confirm: passes, other tests still pass, output pristine (no errors, warnings).
|
||||
|
||||
- Test fails? Fix code, not test.
|
||||
- Other tests fail? Fix now.
|
||||
|
||||
### REFACTOR
|
||||
|
||||
After green only: remove duplication, improve names, extract helpers. Keep tests green. Don't add behavior.
|
||||
|
||||
### Why Order Matters
|
||||
|
||||
**"I'll write tests after"** — Tests written after code pass immediately. Passing immediately proves nothing: might test wrong thing, might test implementation not behavior, might miss edge cases. Test-first forces you to see the test fail, proving it actually tests something.
|
||||
|
||||
**"Already manually tested"** — Manual testing is ad-hoc. No record, can't re-run, easy to forget cases. Automated tests are systematic.
|
||||
|
||||
**"Deleting X hours is wasteful"** — Sunk cost fallacy. The time is already gone. Keeping unverified code is technical debt.
|
||||
|
||||
**"TDD is dogmatic"** — TDD IS pragmatic: finds bugs before commit, prevents regressions, documents behavior, enables refactoring. "Pragmatic" shortcuts = debugging in production = slower.
|
||||
|
||||
### Bug Fix Example
|
||||
|
||||
**Bug:** Empty email accepted
|
||||
|
||||
**RED:**
|
||||
```typescript
|
||||
test('rejects empty email', async () => {
|
||||
const result = await submitForm({ email: '' });
|
||||
expect(result.error).toBe('Email required');
|
||||
});
|
||||
```
|
||||
|
||||
**Verify RED:** FAIL — expected 'Email required', got undefined ✓
|
||||
|
||||
**GREEN:**
|
||||
```typescript
|
||||
function submitForm(data: FormData) {
|
||||
if (!data.email?.trim()) return { error: 'Email required' };
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
**Verify GREEN:** PASS ✓ → **REFACTOR** → extract validation if needed.
|
||||
|
||||
### Verification Checklist
|
||||
|
||||
Before marking work complete:
|
||||
- [ ] Every new function/method has a test
|
||||
- [ ] Watched each test fail before implementing
|
||||
- [ ] Each test failed for expected reason
|
||||
- [ ] Wrote minimal code to pass each test
|
||||
- [ ] All tests pass
|
||||
- [ ] Output pristine (no errors, warnings)
|
||||
- [ ] Tests use real code (mocks only if unavoidable)
|
||||
- [ ] Edge cases and errors covered
|
||||
|
||||
Can't check all boxes? You skipped TDD. Start over.
|
||||
|
||||
### When Stuck
|
||||
|
||||
| Problem | Solution |
|
||||
|---------|----------|
|
||||
| Don't know how to test | Write wished-for API. Write assertion first. Ask your human partner. |
|
||||
| Test too complicated | Design too complicated. Simplify interface. |
|
||||
| Must mock everything | Code too coupled. Use dependency injection. |
|
||||
| Test setup huge | Extract helpers. Still complex? Simplify design. |
|
||||
|
||||
### Testing Anti-Patterns
|
||||
|
||||
When adding mocks or test utilities, avoid these pitfalls:
|
||||
- **Testing mock behavior instead of real behavior** — Assert on real component output, not mock existence
|
||||
- **Adding test-only methods to production classes** — Move to test utilities instead
|
||||
- **Mocking without understanding dependencies** — Understand side effects before mocking; mock at lowest level needed
|
||||
- **Incomplete mocks** — Mock the COMPLETE data structure as it exists in reality
|
||||
- **Tests as afterthought** — Testing is part of implementation, not optional follow-up
|
||||
|
||||
### Common Rationalizations
|
||||
|
||||
| Excuse | Reality |
|
||||
|--------|---------|
|
||||
| "Too simple to test" | Simple code breaks. Test takes 30 seconds. |
|
||||
| "I'll test after" | Tests passing immediately prove nothing. |
|
||||
| "Tests after achieve same goals" | Tests-after = "what does this do?" Tests-first = "what should this do?" |
|
||||
| "Already manually tested" | Ad-hoc ≠ systematic. No record, can't re-run. |
|
||||
| "Deleting X hours is wasteful" | Sunk cost fallacy. Keeping unverified code is debt. |
|
||||
| "Keep as reference" | You'll adapt it. That's testing after. Delete means delete. |
|
||||
| "Need to explore first" | Fine. Throw away exploration, start with TDD. |
|
||||
| "Test hard = design unclear" | Listen to test. Hard to test = hard to use. |
|
||||
| "TDD will slow me down" | TDD faster than debugging. |
|
||||
| "Existing code has no tests" | You're improving it. Add tests for existing code. |
|
||||
| "It's about spirit not ritual" | Violating the letter IS violating the spirit. |
|
||||
|
||||
### Red Flags — STOP and Start Over
|
||||
|
||||
Code before test. Test after implementation. Test passes immediately. Can't explain why test failed. Rationalizing "just this once." "I already manually tested it." "Keep as reference." "This is different because..."
|
||||
|
||||
**All mean: Delete code. Start over with TDD.**
|
||||
|
||||
---
|
||||
|
||||
## 8. Systematic Debugging
|
||||
|
||||
**Use when:** Any bug, test failure, or unexpected behavior — before proposing fixes.
|
||||
|
||||
**Core principle:** ALWAYS find root cause before attempting fixes. Symptom fixes are failure.
|
||||
|
||||
**Violating the letter of this process is violating the spirit of debugging.**
|
||||
|
||||
### The Iron Law
|
||||
|
||||
NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST
|
||||
|
||||
If you haven't completed Phase 1, you cannot propose fixes.
|
||||
|
||||
**Use this ESPECIALLY when:**
|
||||
- Under time pressure (emergencies make guessing tempting)
|
||||
- "Just one quick fix" seems obvious
|
||||
- You've already tried multiple fixes
|
||||
- You don't fully understand the issue
|
||||
|
||||
### Phase 1: Root Cause Investigation
|
||||
|
||||
**BEFORE attempting ANY fix:**
|
||||
|
||||
1. **Read error messages carefully** — don't skip. Read stack traces completely. Note line numbers, file paths, error codes.
|
||||
2. **Reproduce consistently** — exact steps, every time. Not reproducible → gather more data, don't guess.
|
||||
3. **Check recent changes** — git diff, recent commits, new dependencies, config changes, environmental differences.
|
||||
4. **Gather evidence in multi-component systems** — Log data at each component boundary. Run once to see WHERE it breaks. Then investigate that component.
|
||||
|
||||
Example: For CI → build → signing pipeline:
|
||||
```bash
|
||||
# Log at each layer boundary:
|
||||
# Layer 1 (workflow): echo "IDENTITY: ${IDENTITY:+SET}${IDENTITY:-UNSET}"
|
||||
# Layer 2 (build): env | grep IDENTITY
|
||||
# Layer 3 (signing): security find-identity -v
|
||||
# Reveals: which layer the propagation fails
|
||||
```
|
||||
|
||||
5. **Trace data flow** — Where does bad value originate? Trace up the call stack to the source. Fix at source, not symptom.
|
||||
|
||||
**Root cause tracing technique:** Observe symptom → find immediate cause → ask "what called this?" → keep tracing up → find original trigger → fix at source.
|
||||
|
||||
Example: `git init` in wrong directory → `cwd: ''` → `createWorktree('')` → `Session.create()` → test accessed `tempDir` before `beforeEach` → **root cause**: top-level variable initialization.
|
||||
|
||||
### Phase 2: Pattern Analysis
|
||||
|
||||
1. Find working examples of similar code in the codebase
|
||||
2. Compare: what's different between working and broken?
|
||||
3. List every difference, however small
|
||||
4. Understand dependencies and assumptions
|
||||
|
||||
### Phase 3: Hypothesis and Testing
|
||||
|
||||
1. Form single hypothesis: "X is root cause because Y"
|
||||
2. Make SMALLEST possible change to test it
|
||||
3. One variable at a time
|
||||
4. Didn't work → new hypothesis. DON'T add more fixes on top.
|
||||
|
||||
### Phase 4: Implementation
|
||||
|
||||
1. Create failing test reproducing the bug (Section 7: TDD)
|
||||
2. Implement single fix addressing root cause
|
||||
3. Verify: test passes, no other tests broken
|
||||
4. **If 3+ fixes failed:** STOP. Question the architecture. Discuss with your human partner.
|
||||
|
||||
**Pattern indicating architectural problem:**
|
||||
- Each fix reveals new shared state/coupling/problem in different place
|
||||
- Fixes require "massive refactoring" to implement
|
||||
- Each fix creates new symptoms elsewhere
|
||||
|
||||
This is NOT a failed hypothesis — this is a wrong architecture.
|
||||
|
||||
### Supporting Techniques
|
||||
|
||||
- **Defense-in-depth:** After finding root cause, validate at EVERY layer data passes through. Entry point → business logic → environment guards → debug instrumentation. Single validation can be bypassed; multiple layers make the bug structurally impossible.
|
||||
- **Condition-based waiting:** Replace arbitrary timeouts/sleeps with condition polling. Wait for the actual condition, not a guess about timing. `waitFor(() => condition())` instead of `setTimeout(check, 500)`.
|
||||
|
||||
### Common Rationalizations
|
||||
|
||||
| Excuse | Reality |
|
||||
|--------|---------|
|
||||
| "Issue is simple" | Simple issues have root causes too. |
|
||||
| "Emergency, no time" | Systematic is FASTER than thrashing. |
|
||||
| "Just try this first" | First fix sets the pattern. Do it right. |
|
||||
| "I see the problem" | Seeing symptoms ≠ understanding root cause. |
|
||||
| "Multiple fixes saves time" | Can't isolate what worked. Causes new bugs. |
|
||||
| "One more fix attempt" (after 2+) | 3+ failures = architectural problem. Question pattern. |
|
||||
| "Reference too long, I'll adapt" | Partial understanding guarantees bugs. Read completely. |
|
||||
|
||||
### Red Flags — STOP and Follow Process
|
||||
|
||||
- "Quick fix for now, investigate later"
|
||||
- "Just try changing X and see"
|
||||
- Proposing solutions before tracing data flow
|
||||
- "I don't fully understand but this might work"
|
||||
- Each fix reveals new problem in different place
|
||||
- 3+ fix attempts failed → **question the architecture**
|
||||
|
||||
**ALL of these mean: STOP. Return to Phase 1.**
|
||||
|
||||
---
|
||||
|
||||
## 9. Verification Before Completion
|
||||
|
||||
**Use when:** About to claim work is complete, fixed, or passing — before committing or creating PRs.
|
||||
|
||||
**Core principle:** Evidence before claims, always.
|
||||
|
||||
**Violating the letter of this rule is violating the spirit of this rule.**
|
||||
|
||||
### The Iron Law
|
||||
|
||||
NO COMPLETION CLAIMS WITHOUT FRESH VERIFICATION EVIDENCE
|
||||
|
||||
If you haven't run the verification command in this message, you cannot claim it passes.
|
||||
|
||||
### The Gate
|
||||
|
||||
Before claiming ANY status:
|
||||
|
||||
1. IDENTIFY: What command proves this claim?
|
||||
2. RUN: Execute the FULL command (fresh, complete)
|
||||
3. READ: Full output, check exit code, count failures
|
||||
4. VERIFY: Does output confirm the claim?
|
||||
- If NO: State actual status with evidence
|
||||
- If YES: State claim WITH evidence
|
||||
5. ONLY THEN: Make the claim
|
||||
|
||||
Skip any step = lying, not verifying
|
||||
|
||||
### What Counts as Verification
|
||||
|
||||
| Claim | Requires | NOT Sufficient |
|
||||
|-------|----------|----------------|
|
||||
| Tests pass | Test output: 0 failures | Previous run, "should pass" |
|
||||
| Linter clean | Linter output: 0 errors | Partial check, extrapolation |
|
||||
| Build succeeds | Build: exit 0 | Linter passing |
|
||||
| Bug fixed | Test original symptom | Code changed, assumed fixed |
|
||||
| Regression test works | Red-green cycle verified | Test passes once |
|
||||
| Agent completed | VCS diff shows changes | Agent reports "success" |
|
||||
| Requirements met | Line-by-line checklist | Tests passing |
|
||||
|
||||
### Key Patterns
|
||||
|
||||
**Tests:**
|
||||
```
|
||||
✅ [Run test command] [See: 34/34 pass] "All tests pass"
|
||||
❌ "Should pass now" / "Looks correct"
|
||||
```
|
||||
|
||||
**Regression tests (TDD Red-Green):**
|
||||
```
|
||||
✅ Write → Run (pass) → Revert fix → Run (MUST FAIL) → Restore → Run (pass)
|
||||
❌ "I've written a regression test" (without red-green verification)
|
||||
```
|
||||
|
||||
**Agent delegation:**
|
||||
```
|
||||
✅ Agent reports success → Check VCS diff → Verify changes → Report actual state
|
||||
❌ Trust agent report
|
||||
```
|
||||
|
||||
### Red Flags
|
||||
|
||||
- Using "should", "probably", "seems to"
|
||||
- Expressing satisfaction before verification ("Great!", "Perfect!", "Done!")
|
||||
- Trusting agent success reports
|
||||
- Relying on partial verification
|
||||
- ANY wording implying success without having run verification
|
||||
|
||||
**Run the command. Read the output. THEN claim the result.**
|
||||
|
||||
### Rationalization Prevention
|
||||
|
||||
| Excuse | Reality |
|
||||
|--------|---------|
|
||||
| "Should work now" | RUN the verification |
|
||||
| "I'm confident" | Confidence ≠ evidence |
|
||||
| "Just this once" | No exceptions |
|
||||
| "Agent said success" | Verify independently |
|
||||
| "Partial check is enough" | Partial proves nothing |
|
||||
| "Different words so rule doesn't apply" | Spirit over letter |
|
||||
|
||||
---
|
||||
|
||||
## 10. Code Review
|
||||
|
||||
**Use when:** Completing tasks, implementing major features, before merging, or when receiving review feedback.
|
||||
|
||||
### Part 1: Requesting Review
|
||||
|
||||
**Mandatory after:** each task in subagent-driven development, major features, before merge.
|
||||
|
||||
**How to request:**
|
||||
1. Get git SHAs: `BASE_SHA=$(git rev-parse HEAD~1)`, `HEAD_SHA=$(git rev-parse HEAD)`
|
||||
2. Dispatch code-reviewer subagent with the template below
|
||||
3. Act on feedback: fix Critical immediately, fix Important before proceeding, note Minor for later
|
||||
|
||||
**Code Reviewer Template:**
|
||||
|
||||
You are reviewing code changes for production readiness.
|
||||
Review {WHAT_WAS_IMPLEMENTED} against {PLAN_OR_REQUIREMENTS}.
|
||||
Git range: {BASE_SHA}..{HEAD_SHA}
|
||||
|
||||
Check: code quality, architecture, testing, requirements, production readiness.
|
||||
|
||||
Review Checklist:
|
||||
- Code: separation of concerns, error handling, type safety, DRY, edge cases
|
||||
- Architecture: design decisions, scalability, performance, security
|
||||
- Testing: tests test logic not mocks, edge cases, integration tests, all passing
|
||||
- Requirements: all met, matches spec, no scope creep, breaking changes documented
|
||||
|
||||
Output format:
|
||||
### Strengths — what's well done (be specific, file:line)
|
||||
### Issues
|
||||
#### Critical (Must Fix) — bugs, security, data loss
|
||||
#### Important (Should Fix) — architecture, missing features, test gaps
|
||||
#### Minor (Nice to Have) — style, optimization
|
||||
For each: file:line, what's wrong, why it matters, how to fix
|
||||
### Assessment — Ready to merge? [Yes/No/With fixes]
|
||||
|
||||
### Part 2: Receiving Feedback
|
||||
|
||||
**Response pattern:** READ → UNDERSTAND → VERIFY → EVALUATE → RESPOND → IMPLEMENT
|
||||
|
||||
**Forbidden responses — NEVER say:**
|
||||
- "You're absolutely right!" (performative)
|
||||
- "Great point!" / "Excellent feedback!" (performative)
|
||||
- "Let me implement that now" (before verification)
|
||||
|
||||
**Instead:** Restate the technical requirement, ask clarifying questions, push back if wrong, or just fix it.
|
||||
|
||||
**Handling unclear feedback:**
|
||||
```
|
||||
IF any item is unclear:
|
||||
STOP — do not implement anything yet
|
||||
ASK for clarification on ALL unclear items
|
||||
WHY: Items may be related. Partial understanding = wrong implementation.
|
||||
```
|
||||
|
||||
**Implementation order for multi-item feedback:**
|
||||
1. Clarify anything unclear FIRST
|
||||
2. Blocking issues (breaks, security)
|
||||
3. Simple fixes (typos, imports)
|
||||
4. Complex fixes (refactoring, logic)
|
||||
5. Test each fix individually
|
||||
|
||||
**YAGNI check:** If reviewer suggests "implementing properly," grep codebase for actual usage. If unused → "This endpoint isn't called. Remove it (YAGNI)?"
|
||||
|
||||
**When to push back:**
|
||||
- Suggestion breaks existing functionality
|
||||
- Reviewer lacks full context
|
||||
- Violates YAGNI (unused feature)
|
||||
- Technically incorrect for this stack
|
||||
- Conflicts with architectural decisions
|
||||
|
||||
**When feedback IS correct:**
|
||||
```
|
||||
✅ "Fixed. [Brief description]"
|
||||
✅ [Just fix it in code]
|
||||
❌ "You're absolutely right!" / "Thanks for catching that!"
|
||||
```
|
||||
|
||||
Actions speak. Just fix it.
|
||||
|
||||
---
|
||||
|
||||
## 11. Using Git Worktrees
|
||||
|
||||
**Use when:** Starting feature work that needs isolation or before executing implementation plans.
|
||||
|
||||
**Announce at start:** "I'm using the using-git-worktrees skill to set up an isolated workspace."
|
||||
|
||||
### Directory Selection (priority order)
|
||||
|
||||
1. **Check existing:** `ls -d .worktrees 2>/dev/null` (preferred) or `ls -d worktrees 2>/dev/null`
|
||||
- If found: use that directory. If both exist, `.worktrees` wins.
|
||||
2. **Check AGENTS.md:** `grep -i "worktree.*director" AGENTS.md 2>/dev/null`
|
||||
- If preference specified: use without asking.
|
||||
3. **Ask user:** `.worktrees/` (project-local, hidden) or `~/.config/superpowers/worktrees/<project>/` (global)
|
||||
|
||||
### Safety Verification
|
||||
|
||||
For project-local directories: verify directory is in `.gitignore` before creating worktree.
|
||||
|
||||
git check-ignore -q .worktrees 2>/dev/null
|
||||
|
||||
If NOT ignored:
|
||||
1. Add appropriate line to `.gitignore`
|
||||
2. Commit the change
|
||||
3. Proceed with worktree creation
|
||||
|
||||
**Why critical:** Prevents accidentally committing worktree contents to repository.
|
||||
|
||||
### Creation Steps
|
||||
|
||||
1. **Detect project:** `project=$(basename "$(git rev-parse --show-toplevel)")`
|
||||
2. **Create worktree:** `git worktree add "$path" -b "$BRANCH_NAME"`
|
||||
3. **Run project setup** (auto-detect):
|
||||
```bash
|
||||
if [ -f package.json ]; then npm install; fi
|
||||
if [ -f Cargo.toml ]; then cargo build; fi
|
||||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
|
||||
if [ -f pyproject.toml ]; then poetry install; fi
|
||||
if [ -f go.mod ]; then go mod download; fi
|
||||
```
|
||||
4. **Verify clean baseline** — run tests. If tests fail: report failures, ask whether to proceed.
|
||||
5. **Report:** location, test results, ready status
|
||||
|
||||
### Rules
|
||||
|
||||
- Never create worktree without verifying it's ignored (project-local)
|
||||
- Never skip baseline test verification
|
||||
- Never proceed with failing tests without asking
|
||||
- Follow directory priority: existing → AGENTS.md → ask
|
||||
- Auto-detect setup commands from project files
|
||||
|
||||
---
|
||||
|
||||
## 12. Finishing a Development Branch
|
||||
|
||||
**Use when:** Implementation is complete, all tests pass, ready to integrate.
|
||||
|
||||
**Announce at start:** "I'm using the finishing-a-development-branch skill to complete this work."
|
||||
|
||||
### Process
|
||||
|
||||
1. **Verify tests pass** — if failing, stop. Cannot proceed.
|
||||
2. **Determine base branch** — `git merge-base HEAD main 2>/dev/null || git merge-base HEAD master 2>/dev/null`
|
||||
3. **Present exactly 4 options:**
|
||||
```
|
||||
Implementation complete. What would you like to do?
|
||||
1. Merge back to <base-branch> locally
|
||||
2. Push and create a Pull Request
|
||||
3. Keep the branch as-is
|
||||
4. Discard this work
|
||||
```
|
||||
4. **Execute choice**
|
||||
5. **Cleanup worktree** (for options 1, 2, 4 only)
|
||||
|
||||
### Option Details
|
||||
|
||||
| Option | Merge | Push | Keep Worktree | Cleanup Branch |
|
||||
|--------|-------|------|---------------|----------------|
|
||||
| 1. Merge locally | Yes | - | - | Yes |
|
||||
| 2. Create PR | - | Yes | Yes | - |
|
||||
| 3. Keep as-is | - | - | Yes | - |
|
||||
| 4. Discard | - | - | - | Yes (force) |
|
||||
|
||||
**Option 1 (Merge):** Checkout base → pull latest → merge feature → verify tests on merged result → delete feature branch → cleanup worktree
|
||||
|
||||
**Option 2 (Push/PR):** Push branch → `gh pr create` with summary and test plan → cleanup worktree
|
||||
|
||||
**Option 4 (Discard):** Require typed "discard" confirmation. Show what will be deleted (branch, commits, worktree). Then: checkout base → `git branch -D` → cleanup worktree
|
||||
|
||||
### Rules
|
||||
|
||||
- Never proceed with failing tests
|
||||
- Always verify tests on merged result (option 1)
|
||||
- Require typed "discard" confirmation (option 4)
|
||||
- Don't force-push without explicit request
|
||||
- Present exactly 4 options — don't use open-ended questions
|
||||
|
||||
---
|
||||
|
||||
## 13. Writing Skills
|
||||
|
||||
**Use when:** Creating new skills, editing existing skills, or verifying skills work.
|
||||
|
||||
### What is a Skill?
|
||||
|
||||
A reusable reference guide for proven techniques, patterns, or tools. NOT narratives about how you solved a problem once.
|
||||
|
||||
**Skills are:** Reusable techniques, patterns, tools, reference guides
|
||||
**Skills are NOT:** One-off solutions, project-specific conventions, mechanical constraints (automate those instead)
|
||||
|
||||
### The Iron Law (Same as TDD)
|
||||
|
||||
NO SKILL WITHOUT A FAILING TEST FIRST
|
||||
|
||||
Test with subagent pressure scenarios. Watch agents fail without skill (RED). Write minimal skill (GREEN). Close loopholes (REFACTOR).
|
||||
|
||||
### SKILL.md Structure
|
||||
|
||||
---
|
||||
name: skill-name-with-hyphens
|
||||
description: "Use when [specific triggering conditions]"
|
||||
---
|
||||
|
||||
Sections: Overview → When to Use → Core Pattern → Quick Reference → Common Mistakes
|
||||
|
||||
### Description Field (Critical for Discovery)
|
||||
|
||||
**CRITICAL: Description = When to Use, NOT What the Skill Does**
|
||||
|
||||
Agents read description to decide which skills to load. The description should ONLY describe triggering conditions. Do NOT summarize the skill's process or workflow.
|
||||
|
||||
**Why:** Testing revealed that when a description summarizes workflow, agents follow the description shortcut instead of reading the full skill. A description saying "code review between tasks" caused an agent to do ONE review, even though the skill specified TWO reviews (spec + quality).
|
||||
|
||||
```yaml
|
||||
# ❌ BAD: Summarizes workflow — agent may follow this instead of reading skill
|
||||
description: Use when executing plans - dispatches subagent per task with code review
|
||||
|
||||
# ✅ GOOD: Just triggering conditions
|
||||
description: Use when executing implementation plans with independent tasks
|
||||
```
|
||||
|
||||
### Naming
|
||||
|
||||
- Verb-first, active voice: `condition-based-waiting` not `async-test-helpers`
|
||||
- Gerunds work well: `creating-skills`, `testing-skills`
|
||||
- Name by what you DO: `root-cause-tracing` not `debugging-techniques`
|
||||
|
||||
### Key Rules
|
||||
|
||||
- One excellent example beats many mediocre ones
|
||||
- Flowcharts only for non-obvious decisions
|
||||
- Keep inline unless reference >100 lines
|
||||
- Test BEFORE deploying. No exceptions.
|
||||
|
||||
### Bulletproofing Against Rationalization
|
||||
|
||||
Skills that enforce discipline need to resist rationalization:
|
||||
|
||||
1. **Close every loophole explicitly** — Don't just state the rule; forbid specific workarounds ("Don't keep it as reference, don't adapt it, delete means delete")
|
||||
2. **Address "spirit vs letter"** — Add "Violating the letter IS violating the spirit" early
|
||||
3. **Build rationalization table** — Capture every excuse agents make, add counters
|
||||
4. **Create red flags list** — Make it easy to self-check when rationalizing
|
||||
|
||||
### Skill Creation Checklist
|
||||
|
||||
**RED:** Create pressure scenarios → run WITHOUT skill → document baseline failures (exact rationalizations agents use)
|
||||
**GREEN:** Write skill addressing specific failures → run WITH skill → verify compliance
|
||||
**REFACTOR:** Find new rationalizations → add counters → re-test until bulletproof
|
||||
|
||||
### Common Rationalizations for Skipping Testing
|
||||
|
||||
| Excuse | Reality |
|
||||
|--------|---------|
|
||||
| "Skill is obviously clear" | Clear to you ≠ clear to agents. Test it. |
|
||||
| "It's just a reference" | References can have gaps. Test retrieval. |
|
||||
| "Testing is overkill" | Untested skills always have issues. 15 min saves hours. |
|
||||
| "I'll test if problems emerge" | Problems = agents can't use skill. Test BEFORE deploying. |
|
||||
| "No time to test" | Deploying untested skill wastes more time fixing later. |
|
||||
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"owner": "cutd",
|
||||
"slug": "claw-superpowers",
|
||||
"displayName": "claw-superpowers",
|
||||
"latest": {
|
||||
"version": "1.0.1",
|
||||
"publishedAt": 1773111136740,
|
||||
"commit": "https://github.com/openclaw/skills/commit/720aedbd618f70e5d23de7b68f9c0b45a3d7aa55"
|
||||
},
|
||||
"history": [
|
||||
{
|
||||
"version": "1.0.0",
|
||||
"publishedAt": 1772673651563,
|
||||
"commit": "https://github.com/openclaw/skills/commit/fa7462f557f358244a2ed1675ec8148ee853ff2c"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"skills": [
|
||||
{
|
||||
"name": "skill-vetter",
|
||||
"source_url": "https://github.com/openclaw/skills/tree/HEAD/skills/spclaudehome/skill-vetter",
|
||||
"installed_path": "C:/Users/afree/.codex/skills/skill-vetter",
|
||||
"snapshot_path": "D:/Document Cleaning/project-governance/skills/snapshots/skill-vetter"
|
||||
},
|
||||
{
|
||||
"name": "superpowers",
|
||||
"source_url": "https://github.com/openclaw/skills/tree/HEAD/skills/cutd/claw-superpowers",
|
||||
"installed_path": "C:/Users/afree/.codex/skills/superpowers",
|
||||
"snapshot_path": "D:/Document Cleaning/project-governance/skills/snapshots/superpowers"
|
||||
},
|
||||
{
|
||||
"name": "frontend-design",
|
||||
"source_url": "https://github.com/vadimcomanescu/codex-skills/tree/HEAD/skills/.curated/design/frontend-design",
|
||||
"installed_path": "C:/Users/afree/.codex/skills/frontend-design",
|
||||
"snapshot_path": "D:/Document Cleaning/project-governance/skills/snapshots/frontend-design"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
# Skill Vetting Report
|
||||
|
||||
Review scope: local installed copies under `C:\Users\afree\.codex\skills`.
|
||||
|
||||
## Verdict
|
||||
|
||||
- `skill-vetter`: install approved
|
||||
- `superpowers`: install approved
|
||||
- `frontend-design`: install approved
|
||||
|
||||
## skill-vetter
|
||||
|
||||
- Source: `openclaw/skills`
|
||||
- Files reviewed: `SKILL.md`, `_meta.json`
|
||||
- Observed behavior: documentation only; no scripts, package installs, or network actions inside the skill body
|
||||
- Scope: guidance for reviewing third-party skills before installation
|
||||
- Risk level: Low
|
||||
|
||||
## superpowers
|
||||
|
||||
- Source: `openclaw/skills`
|
||||
- Files reviewed: `SKILL.md`, `_meta.json`
|
||||
- Observed behavior: process and methodology guidance only; no executable scripts bundled
|
||||
- Scope: workflow discipline for planning, execution, testing, debugging, and review
|
||||
- Risk level: Low
|
||||
|
||||
## frontend-design
|
||||
|
||||
- Source: `vadimcomanescu/codex-skills`
|
||||
- Files reviewed: `SKILL.md`, `LICENSE.txt`, `references/*`, `assets/*`
|
||||
- Observed behavior: design guidance plus static starter assets; no credential access, no package install logic, no hidden network calls
|
||||
- Scope: frontend design direction, tokens, layout, accessibility, and starter templates
|
||||
- Risk level: Low
|
||||
|
||||
## Red-Flag Check
|
||||
|
||||
The following high-risk patterns were not found in the reviewed local copies:
|
||||
|
||||
- hidden credential access
|
||||
- external data exfiltration logic
|
||||
- obfuscated code
|
||||
- shell commands with elevated permissions
|
||||
- writes outside intended skill folder
|
||||
|
||||
## Operational Rule
|
||||
|
||||
Any additional external skill introduced to this repo must be reviewed with `skill-vetter` first and then recorded in this folder.
|
||||
@@ -0,0 +1,32 @@
|
||||
# Development Workflow
|
||||
|
||||
This project keeps workflow governance separate from product code.
|
||||
|
||||
## Folder Split
|
||||
|
||||
- Application code: `backend/`, `frontend/`
|
||||
- Governance and AI workflow: `project-governance/`
|
||||
|
||||
## Mandatory Skill Order
|
||||
|
||||
1. `skill-vetter`
|
||||
- Use before installing any new third-party skill or automation helper.
|
||||
2. `superpowers`
|
||||
- Use for brainstorming, planning, execution, test verification, debugging, and review.
|
||||
3. `frontend-design`
|
||||
- Use for any page, component, layout, token, or visual interaction change.
|
||||
|
||||
## Default Delivery Flow
|
||||
|
||||
1. Brainstorm the task and identify risks.
|
||||
2. Write the implementation plan.
|
||||
3. Implement in small verified steps.
|
||||
4. Run tests/builds before claiming completion.
|
||||
5. Review the result and note any remaining risk.
|
||||
|
||||
## Project-Specific Rules
|
||||
|
||||
- Do not mix skill governance files into `backend/` or `frontend/`.
|
||||
- Keep required skill references in `project-governance/skills/`.
|
||||
- Keep deployment and runtime configuration in the repo root and service folders only.
|
||||
- If a new dependency or external tool is introduced, record the reason in this governance area.
|
||||
Binary file not shown.
@@ -0,0 +1,2 @@
|
||||
smoke-input
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,6 @@
|
||||
Document Cleaning Smoke Test
|
||||
|
||||
This file is prepared for a real local smoke test.
|
||||
The goal is to verify upload, conversion, download, and delete against the running service.
|
||||
Owner: Codex
|
||||
Purpose: Integration validation
|
||||
Reference in new issue
Block a user