blamcode 0.4.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- blamcode/__init__.py +9 -0
- blamcode/cli.py +122 -0
- blamcode/layer/README.md +43 -0
- blamcode/layer/config/agent/build.md +118 -0
- blamcode/layer/config/agent/debugger.md +32 -0
- blamcode/layer/config/agent/designer.md +31 -0
- blamcode/layer/config/agent/vision.md +26 -0
- blamcode/layer/config/agent/writer.md +28 -0
- blamcode/layer/config/command/ask.md +41 -0
- blamcode/layer/config/command/blam.md +24 -0
- blamcode/layer/config/command/explore.md +14 -0
- blamcode/layer/config/command/fix.md +14 -0
- blamcode/layer/config/command/open.md +18 -0
- blamcode/layer/config/command/review.md +14 -0
- blamcode/layer/config/opencode.json +53 -0
- blamcode/layer/config/themes/bangladeshi.json +67 -0
- blamcode/layer/config/themes/blamcode.json +217 -0
- blamcode/layer/config/tui.json +4 -0
- blamcode/layer/install.sh +752 -0
- blamcode/layer/scripts/__pycache__/patch-brand.cpython-312.pyc +0 -0
- blamcode/layer/scripts/blamcode +518 -0
- blamcode/layer/scripts/blamcode-browser +315 -0
- blamcode/layer/scripts/blamcode-menu +140 -0
- blamcode/layer/scripts/blamcode-uninstall +71 -0
- blamcode/layer/scripts/blamcode-vision +542 -0
- blamcode/layer/scripts/oc-settings.sh +138 -0
- blamcode/layer/scripts/patch-brand.py +267 -0
- blamcode/layer/skills/android-app/SKILL.md +53 -0
- blamcode/layer/skills/api-integration/SKILL.md +49 -0
- blamcode/layer/skills/bash-cli-expert/SKILL.md +48 -0
- blamcode/layer/skills/bot-development/SKILL.md +53 -0
- blamcode/layer/skills/clean-code-performance/SKILL.md +45 -0
- blamcode/layer/skills/database/SKILL.md +56 -0
- blamcode/layer/skills/debugging-fixes/SKILL.md +45 -0
- blamcode/layer/skills/deploy-hosting/SKILL.md +38 -0
- blamcode/layer/skills/docker/SKILL.md +74 -0
- blamcode/layer/skills/firebase-supabase/SKILL.md +61 -0
- blamcode/layer/skills/git-workflow/SKILL.md +63 -0
- blamcode/layer/skills/lets-scroll/SKILL.md +877 -0
- blamcode/layer/skills/lets-scroll/references/index-template.html +73 -0
- blamcode/layer/skills/lets-scroll/references/knockout.py +89 -0
- blamcode/layer/skills/lets-scroll/references/pipeline.md +312 -0
- blamcode/layer/skills/lets-scroll/references/prompts.md +194 -0
- blamcode/layer/skills/lets-scroll/references/scrub-engine.js +448 -0
- blamcode/layer/skills/project-structure/SKILL.md +74 -0
- blamcode/layer/skills/python-automation/SKILL.md +52 -0
- blamcode/layer/skills/react-next-best-practices/SKILL.md +54 -0
- blamcode/layer/skills/security-review/SKILL.md +48 -0
- blamcode/layer/skills/seo-basics/SKILL.md +44 -0
- blamcode/layer/skills/testing/SKILL.md +58 -0
- blamcode/layer/skills/ui-ux-responsive/SKILL.md +53 -0
- blamcode/layer/skills/website-builder/SKILL.md +47 -0
- blamcode-0.4.0.dist-info/METADATA +62 -0
- blamcode-0.4.0.dist-info/RECORD +58 -0
- blamcode-0.4.0.dist-info/WHEEL +5 -0
- blamcode-0.4.0.dist-info/entry_points.txt +2 -0
- blamcode-0.4.0.dist-info/licenses/LICENSE +21 -0
- blamcode-0.4.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: docker
|
|
3
|
+
description: Docker for desktop users — containers, images, docker-compose — run and isolate apps. Use when user has a PC/server with Docker and wants to package, run, or keep apps isolated.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Docker Skill (Desktop Users)
|
|
7
|
+
|
|
8
|
+
## When Docker makes sense
|
|
9
|
+
- The user has a PC or VPS (Termux itself can't run Docker natively — no proot needed, it just won't work)
|
|
10
|
+
- Multiple apps on one server that must not conflict (different Python/Node versions)
|
|
11
|
+
- Reproducible deploys — "works on my machine" disappears
|
|
12
|
+
- For a simple single app on a phone — Docker is overkill; skip it
|
|
13
|
+
|
|
14
|
+
## Basic workflow
|
|
15
|
+
```dockerfile
|
|
16
|
+
# Dockerfile — small, safe
|
|
17
|
+
FROM python:3.12-slim
|
|
18
|
+
WORKDIR /app
|
|
19
|
+
COPY requirements.txt .
|
|
20
|
+
RUN pip install --no-cache-dir -r requirements.txt
|
|
21
|
+
COPY . .
|
|
22
|
+
CMD ["python", "main.py"]
|
|
23
|
+
```
|
|
24
|
+
```sh
|
|
25
|
+
docker build -t myapp . # build the image
|
|
26
|
+
docker run -p 8080:8080 myapp # run it (host port 8080 → container 8080)
|
|
27
|
+
docker ps # list running containers
|
|
28
|
+
docker stop <id> # stop one
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## docker-compose (multiple services — the usual real case)
|
|
32
|
+
```yaml
|
|
33
|
+
# docker-compose.yml
|
|
34
|
+
services:
|
|
35
|
+
web:
|
|
36
|
+
build: .
|
|
37
|
+
ports: ["8080:8080"]
|
|
38
|
+
environment:
|
|
39
|
+
DB_URL: postgres://user:pass@db:5432/app
|
|
40
|
+
depends_on: [db]
|
|
41
|
+
db:
|
|
42
|
+
image: postgres:16
|
|
43
|
+
environment:
|
|
44
|
+
POSTGRES_PASSWORD: change_me
|
|
45
|
+
volumes:
|
|
46
|
+
- pgdata:/var/lib/postgresql/data
|
|
47
|
+
volumes:
|
|
48
|
+
pgdata:
|
|
49
|
+
```
|
|
50
|
+
```sh
|
|
51
|
+
docker compose up -d # start everything in the background
|
|
52
|
+
docker compose logs -f # follow logs
|
|
53
|
+
docker compose down # stop (add -v to delete data volumes — careful!)
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Rules (strict)
|
|
57
|
+
- **Never put secrets in the Dockerfile** (they end up in image history).
|
|
58
|
+
Use `.env` + `environment:` / compose `env_file:`
|
|
59
|
+
- **Don't run as root in the container** — add a non-root user:
|
|
60
|
+
`RUN useradd -m app && USER app`
|
|
61
|
+
- Pin versions (`python:3.12-slim`, `postgres:16`) — `latest` breaks builds later
|
|
62
|
+
- `.dockerignore` — keep node_modules, .git, .env out of the build context (faster + safer)
|
|
63
|
+
- One process per container; data in **volumes**, never inside the container (lost on recreate)
|
|
64
|
+
- `docker exec -it <id> sh` to debug inside
|
|
65
|
+
|
|
66
|
+
## Common fixes
|
|
67
|
+
- "port already in use" → `docker ps` shows another container → stop it or change `-p` port
|
|
68
|
+
- Container exits instantly → `docker logs <id>` — the app crashed at startup
|
|
69
|
+
- Can't reach the app → check `-p HOST:CONTAINER` mapping and the app binds 0.0.0.0 inside
|
|
70
|
+
- Build too slow → run again; layers are cached. Put `requirements.txt` BEFORE the code copy
|
|
71
|
+
|
|
72
|
+
## Deliver
|
|
73
|
+
- Dockerfile + compose file + the exact commands to build/run/stop
|
|
74
|
+
- One line on how to update: rebuild + `docker compose up -d` again
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: firebase-supabase
|
|
3
|
+
description: Backend without your own server — Firebase and Supabase: auth, database, storage, hosting. Use when user wants a backend, login system, realtime data, or "server-less" storage for an app.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Firebase + Supabase Skill (Backend Without a Server)
|
|
7
|
+
|
|
8
|
+
## Choose the platform
|
|
9
|
+
- **Supabase** — PostgreSQL, SQL, generous **free tier**, more transparent pricing.
|
|
10
|
+
Best default for new projects
|
|
11
|
+
- **Firebase** — Google, realtime database + very easy auth, great for quick apps;
|
|
12
|
+
free tier is small and billing surprises are common. Use when the user prefers Google
|
|
13
|
+
- Both give: database, auth, file storage, hosting — no server to manage
|
|
14
|
+
|
|
15
|
+
## Supabase quick start
|
|
16
|
+
```sh
|
|
17
|
+
npm i @supabase/supabase-js
|
|
18
|
+
```
|
|
19
|
+
```js
|
|
20
|
+
import { createClient } from '@supabase/supabase-js';
|
|
21
|
+
const supabase = createClient(import.meta.env.VITE_SUPABASE_URL,
|
|
22
|
+
import.meta.env.VITE_SUPABASE_ANON_KEY);
|
|
23
|
+
// fetch rows
|
|
24
|
+
const { data, error } = await supabase.from('todos').select('*').order('created_at');
|
|
25
|
+
// insert
|
|
26
|
+
const { error: err2 } = await supabase.from('todos').insert({ title: 'Buy milk' });
|
|
27
|
+
```
|
|
28
|
+
- Keys in `.env` (Vite: `VITE_` prefix) — the **anon key is public by design**;
|
|
29
|
+
real security comes from **RLS (Row Level Security)** policies — enable them!
|
|
30
|
+
|
|
31
|
+
## Firebase quick start
|
|
32
|
+
```js
|
|
33
|
+
import { initializeApp } from 'firebase/app';
|
|
34
|
+
import { getFirestore, collection, addDoc, getDocs } from 'firebase/firestore';
|
|
35
|
+
const app = initializeApp({ /* config from Firebase console */ });
|
|
36
|
+
const db = getFirestore(app);
|
|
37
|
+
await addDoc(collection(db, 'todos'), { title: 'Buy milk', done: false });
|
|
38
|
+
```
|
|
39
|
+
- Firestore security rules: use `match /todos/{id}` + `allow read, write: if request.auth != null` — default "open" is dangerous
|
|
40
|
+
|
|
41
|
+
## Security rules (MUST — both platforms)
|
|
42
|
+
- **Never trust the client.** The anon key / config is public — the database rules
|
|
43
|
+
are the real lock
|
|
44
|
+
- Default = deny; allow the minimum (`if request.auth != null`, ownership checks:
|
|
45
|
+
`request.auth.uid == resource.data.user_id`)
|
|
46
|
+
- Test the rules from a second browser/incognito to prove they block
|
|
47
|
+
|
|
48
|
+
## Auth patterns
|
|
49
|
+
- Email+password easiest; Google sign-in great UX (needs OAuth client config)
|
|
50
|
+
- Store the user id (`auth.uid`) on every row so ownership checks work
|
|
51
|
+
- Never store passwords yourself — let the platform handle auth
|
|
52
|
+
|
|
53
|
+
## Hosting
|
|
54
|
+
- **Supabase**: static hosting via Netlify/Vercel + the Supabase backend (see deploy-hosting skill)
|
|
55
|
+
- **Firebase Hosting**: `npm i -g firebase-tools` → `firebase deploy` (only from PC
|
|
56
|
+
realistically — Termux has issues; Netlify/Vercel work fine from the browser)
|
|
57
|
+
|
|
58
|
+
## Deliver
|
|
59
|
+
- The app + working demo instructions
|
|
60
|
+
- Explain the free-tier limits honestly (Supabase: 500 MB DB, Firestore: 1 GiB / day free)
|
|
61
|
+
- Remind: enable RLS / security rules — say it is not optional
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: git-workflow
|
|
3
|
+
description: Clean, safe git — create repos, commit, branch, push, resolve conflicts, upload to GitHub. Use for any git/GitHub task.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Git Workflow Skill (Full-Power)
|
|
7
|
+
|
|
8
|
+
## Termux setup (first time)
|
|
9
|
+
```sh
|
|
10
|
+
git config --global user.name "Name"
|
|
11
|
+
git config --global user.email "email@example.com"
|
|
12
|
+
```
|
|
13
|
+
- Pushing needs a GitHub PAT (fine-grained, repo access only) — help the user
|
|
14
|
+
set it up; never save or log the key in any file
|
|
15
|
+
|
|
16
|
+
## Safety rules
|
|
17
|
+
- No commit/push unless the user asked for it
|
|
18
|
+
- Before committing: check `git status` + `git diff` — stage only intended files
|
|
19
|
+
- Secret check: `.env`, `*.key`, tokens — if they appear in the diff, stop
|
|
20
|
+
- Put `.env` in `.gitignore` from the start
|
|
21
|
+
- Never `git push --force` (only if the user explicitly asks, with a warning)
|
|
22
|
+
- Never rewrite history (rebase -i, amending pushed commits) — fix forward
|
|
23
|
+
|
|
24
|
+
## Daily flows
|
|
25
|
+
```sh
|
|
26
|
+
# new work
|
|
27
|
+
git checkout -b feature/login
|
|
28
|
+
# ... work ...
|
|
29
|
+
git add <files> && git commit -m "login page add"
|
|
30
|
+
|
|
31
|
+
# pull updates
|
|
32
|
+
git pull --ff-only
|
|
33
|
+
|
|
34
|
+
# undo last commit (soft — changes stay)
|
|
35
|
+
git reset --soft HEAD~1
|
|
36
|
+
|
|
37
|
+
# save local mess for later
|
|
38
|
+
git stash # ...do other work...
|
|
39
|
+
git stash pop
|
|
40
|
+
|
|
41
|
+
# discard a file's changes (before committing)
|
|
42
|
+
git checkout -- <file>
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Commit message style
|
|
46
|
+
- Short + present tense: `add login page`, `fix navbar overflow on mobile`
|
|
47
|
+
- Why the change happened (2-3 lines in the body for big changes)
|
|
48
|
+
|
|
49
|
+
## Conflict resolve
|
|
50
|
+
1. `git status` — which files conflict
|
|
51
|
+
2. Read the file — the `<<<<<<<` markers show both sides
|
|
52
|
+
3. Merge based on BOTH sides' intention — never blindly pick one side
|
|
53
|
+
4. Delete the markers, `git add`, commit
|
|
54
|
+
|
|
55
|
+
## Uploading a new project to GitHub
|
|
56
|
+
```sh
|
|
57
|
+
git init && git add . && git commit -m "first commit"
|
|
58
|
+
git branch -M main
|
|
59
|
+
git remote add origin https://github.com/<user>/<repo>.git
|
|
60
|
+
git push -u origin main
|
|
61
|
+
```
|
|
62
|
+
- Files over 50MB won't go to GitHub — use Git LFS or a media cloud link
|
|
63
|
+
- Confirm with the user whether the repo should be public or private
|