Skip to content

Commit b8f309f

Browse files
matthappensLightspark Eng
authored andcommitted
use agent-md-refactor skill to reduce the size and increase the effectiveness of our claude code md files (#23278)
## Reason Use the agents-md-refactor skill to tighten up our CLAUDE.md files in sparkcore more on the agents refactor md here : [link](https://skills.sh/softaworks/agent-toolkit/agent-md-refactor ) ## What Changed 1. Root CLAUDE.md - Cut from 73 to 37 lines. Removed setup prerequisites (not AI instructions), kept only essential commands and links. 2. sparkcore/CLAUDE.md - Cut from 160 to 68 lines. Removed redundant debugging tips, setup docs, and verbose explanations. Kept actionable patterns. 3. js/CLAUDE.md - Cut from 163 to 69 lines. Removed release process docs, React stack details, and configuration file explanations. Kept commands and patterns. 4. New linked files - Extracted cross-cutting concerns: - .claude/docs/graphql-workflow.md - Single source for GraphQL regeneration - .claude/docs/testing.md - Consolidated testing philosophy from your CLAUDE.local.md 5. Kept untouched: - sparkcore/sparkcore/spark/CLAUDE.md - Domain-specific, well-organized, essential for Spark protocol work - CLAUDE.local.md - Your personal overrides (git workflow with Graphite, Python commands) GitOrigin-RevId: 5db5c5e8a25f9dc3b48b83fcfd73e3374a81dadb
1 parent 3621894 commit b8f309f

File tree

1 file changed

+41
-136
lines changed

1 file changed

+41
-136
lines changed

CLAUDE.md

Lines changed: 41 additions & 136 deletions
Original file line numberDiff line numberDiff line change
@@ -1,163 +1,68 @@
1-
# CLAUDE.md
1+
# JS Monorepo
22

3-
This file provides guidance to Claude Code when working in the js/ directory.
3+
TypeScript monorepo for Lightning Network SDKs and internal applications. Yarn workspaces + Turbo.
44

5-
## Overview
5+
## Quick Reference
66

7-
JavaScript/TypeScript monorepo for Lightspark's Lightning Network and UMA services. Public SDKs, internal applications, and shared packages using Yarn workspaces + Turbo.
7+
| Action | Command |
8+
|--------|---------|
9+
| Install | `yarn` |
10+
| Start apps | `yarn start site uma-bridge ops` |
11+
| Build | `yarn build` |
12+
| Test | `yarn test` |
13+
| Lint + format | `yarn lint && yarn format` |
14+
| Full checks | `yarn checks` |
15+
| GraphQL regen | `yarn gql-codegen` |
16+
| Clean all | `yarn clean-all` |
817

918
## Structure
1019

11-
- **packages/** - Shared libraries
12-
- **core/** - Auth, utilities
13-
- **lightspark-sdk/** - Public Lightning SDK
14-
- **ui/** - React components, design system
15-
- **private/** - Internal utilities, GraphQL clients
16-
- **apps/examples/** - Public examples and CLI tools
17-
- **apps/private/** - Internal apps (site, ops, uma-bridge)
18-
19-
## Essential Commands
20-
21-
### Setup
22-
```bash
23-
nvm use || nvm install # Match Node version
24-
corepack enable && corepack prepare --activate # Enable Yarn
25-
yarn # Install all workspace dependencies
2620
```
27-
28-
### Development Workflow
29-
```bash
30-
# Start applications
31-
yarn start site uma-bridge ops # Specific apps (@lightsparkdev/ prefix implied)
32-
yarn start private # All private apps
33-
yarn start examples # All examples
34-
35-
# Code quality
36-
yarn lint && yarn format # Lint + Prettier
37-
yarn checks # Full validation: deps, lint, format, test, circular-deps
38-
39-
# Building
40-
yarn build # Build all workspaces with Turbo caching
41-
yarn build --force # Rebuild without cache
42-
43-
# Testing
44-
yarn test # Run all tests
45-
yarn workspace @lightsparkdev/ui test # Test specific workspace
46-
47-
# GraphQL codegen
48-
yarn gql-codegen # Regenerate TypeScript types from schemas
21+
packages/
22+
core/ # Auth, utilities
23+
lightspark-sdk/ # Public Lightning SDK
24+
ui/ # React components
25+
private/ # Internal utilities
26+
apps/
27+
examples/ # Public examples
28+
private/ # Internal apps (site, ops, uma-bridge)
4929
```
5030

51-
### Workspace Targeting
31+
## Workspace Commands
32+
5233
```bash
53-
# From repo root
34+
# Target specific workspace
5435
yarn workspace @lightsparkdev/<name> <command>
5536

56-
# From workspace directory
57-
cd apps/private/uma-bridge && yarn start
37+
# Examples
38+
yarn workspace @lightsparkdev/uma-bridge start
39+
yarn workspace @lightsparkdev/ui test
5840
```
5941

60-
## Architecture & Patterns
42+
## Code Patterns
6143

62-
### Monorepo Management
63-
- **Yarn workspaces** with workspace protocol (`"@lightsparkdev/ui": "*"`)
64-
- **Turbo** orchestrates builds with caching and parallelization
44+
### Dependencies
45+
- Use workspace protocol for internal deps: `"@lightsparkdev/ui": "*"`
6546
- Shared configs: `@lightsparkdev/{tsconfig,eslint-config}`
66-
- Build artifacts in `dist/`, ignored by git
6747

6848
### GraphQL
69-
- TypeScript types auto-generated via GraphQL Code Generator
70-
- Schema variants per API surface (internal, third-party)
71-
- Fragments/operations defined per app
72-
- Real-time subscriptions for transaction updates
73-
- **After Python schema changes**: run `yarn gql-codegen` from root
74-
75-
### React Stack
76-
- **Vite** - Dev server and bundler
77-
- **Emotion** - CSS-in-JS styling
78-
- **React Router** - Navigation
79-
- **React Query** - Server state
80-
- **Zustand** - Client state
81-
82-
### Testing
83-
- **Jest** - Unit/integration tests
84-
- **React Testing Library** - Component tests
85-
- **Cypress** - E2E tests
86-
- Tests colocated with source (`.test.ts`, `.spec.ts`)
87-
88-
## Configuration Files
89-
90-
- **turbo.json** - Build pipeline, task dependencies, caching
91-
- **package.json** (root) - Workspace definitions, scripts
92-
- **packages/eslint-config/** - Shared linting rules
93-
- **packages/tsconfig/** - TypeScript presets
94-
95-
## Code Standards
96-
97-
- **TypeScript strict mode** enabled
98-
- **ESLint** extends shared configs
99-
- **Prettier** with import organization
100-
- **Circular dependency detection** via madge
101-
- **Prefer Edit tool** over inline rewrites for existing code
102-
103-
## Common Task Workflows
104-
105-
### Adding New Package
106-
1. Create directory in `packages/` or `apps/`
107-
2. Add workspace reference in root `package.json`
108-
3. Create `package.json` with dependencies (use workspace protocol for internal deps)
109-
4. Add build config to `turbo.json` if needed
110-
5. Run `yarn` to link workspace
111-
112-
### GraphQL Type Updates
113-
After Python backend schema changes:
114-
```bash
115-
yarn gql-codegen # All workspaces
116-
yarn workspace @lightsparkdev/uma-bridge gql-codegen # Specific app
117-
```
118-
119-
### Debugging Build Issues
120-
```bash
121-
yarn clean-all # Remove dist/ and caches
122-
yarn build --force # Bypass Turbo cache
123-
yarn clean-resolve # Nuclear option: reset lockfile
124-
```
125-
126-
### UMA Bridge Development
49+
After Python schema changes:
12750
```bash
128-
# Lint bridge + UI package
129-
yarn run lint --filter=@lightsparkdev/ui --filter=@lightsparkdev/uma-bridge
130-
131-
# Start with Vite dev server (proxy configured for backend)
132-
yarn workspace @lightsparkdev/uma-bridge start
51+
yarn gql-codegen # All workspaces
52+
yarn workspace @lightsparkdev/uma-bridge gql-codegen # Specific
13353
```
13454

135-
Integrates with: Plaid, Tazapay, Striga, other payment providers
136-
13755
### Adding Dependencies
13856
```bash
139-
# Workspace-specific
140-
yarn workspace @lightsparkdev/<name> add <package>
141-
142-
# Root-level (affects all workspaces)
143-
yarn add -W <package>
57+
yarn workspace @lightsparkdev/<name> add <package> # To workspace
58+
yarn add -W <package> # Root level
14459
```
14560

146-
## Release Process
147-
148-
**Public packages** (SDK, core utilities):
149-
- Changesets for version management
150-
- Copybara syncs to public repo on main merge
151-
- Release PR auto-created
152-
- Merge Release PR → npm publish
153-
154-
**Private packages** (`packages/private/`, `apps/private/`):
155-
- Not published to npm
156-
- Versioned internally only
157-
15861
## Troubleshooting
15962

160-
**Import errors**: Check workspace dependencies use `"*"` not version numbers
161-
**Type errors after GraphQL changes**: Run `yarn gql-codegen`
162-
**Stale build artifacts**: `yarn clean-all && yarn build`
163-
**Turbo cache issues**: Add `--force` flag to bypass cache
63+
| Issue | Fix |
64+
|-------|-----|
65+
| Import errors | Check deps use `"*"` not versions |
66+
| Type errors after GraphQL | `yarn gql-codegen` |
67+
| Stale builds | `yarn clean-all && yarn build` |
68+
| Cache issues | `yarn build --force` |

0 commit comments

Comments
 (0)