Skip to content

Commit ef26502

Browse files
committed
skills + dep updates
1 parent bcd1d49 commit ef26502

11 files changed

Lines changed: 1909 additions & 172 deletions

File tree

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,26 @@ npm run test:watch
205205
npm run test:coverage
206206
```
207207

208+
## AI Agent Skills
209+
210+
flame ships with [TanStack Intent](https://github.com/TanStack/intent) skills that give AI coding agents (Claude Code, Cursor, Copilot, etc.) accurate, task-focused guidance for using flame.
211+
212+
If you use an AI agent, run the following in your project to install the skills:
213+
214+
```bash
215+
npx @tanstack/intent@latest install
216+
```
217+
218+
Skills available:
219+
220+
| Skill | Description |
221+
| ----------------------- | ---------------------------------------------- |
222+
| `flame-getting-started` | Init, config, emulator setup, ADC auth |
223+
| `flame-upload` | Uploading documents, `--idField`, path routing |
224+
| `flame-test-data` | Seeding mock data to the Firestore emulator |
225+
| `flame-backup-restore` | Exporting and restoring collections |
226+
| `flame-data-management` | Read, copy, move, delete documents |
227+
208228
## Tech Stack
209229

210230
- [Stricli](https://github.com/bloomberg/stricli) - Type-safe CLI framework

package-lock.json

Lines changed: 379 additions & 169 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
{
22
"name": "flame-cli",
33
"author": "",
4+
"repository": {
5+
"type": "git",
6+
"url": "https://github.com/rk234/flame-cli"
7+
},
48
"description": "A simple CLI to interact with Firestore databases",
59
"license": "MIT",
610
"type": "module",
7-
"version": "0.1.1",
11+
"version": "0.2.0",
812
"files": [
9-
"dist"
13+
"dist",
14+
"skills",
15+
"!skills/_artifacts"
1016
],
1117
"bin": {
1218
"flame": "dist/cli.js",
@@ -49,12 +55,16 @@
4955
"strip-ansi": "^7.1.2"
5056
},
5157
"devDependencies": {
58+
"@tanstack/intent": "^0.0.29",
5259
"@types/node": "22.x",
5360
"@vitest/coverage-v8": "^4.0.18",
5461
"husky": "^9.1.7",
5562
"prettier": "^3.8.1",
5663
"tsup": "^6.7.0",
5764
"typescript": "5.6.x",
5865
"vitest": "^4.0.18"
59-
}
66+
},
67+
"keywords": [
68+
"tanstack-intent"
69+
]
6070
}

skills/_artifacts/domain_map.yaml

Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
library: flame-cli
2+
description: >
3+
A developer-friendly CLI for interacting with Firebase Firestore databases.
4+
Primary use cases: seeding test data to the local emulator, one-off document
5+
operations, backups, and exports. Built with Stricli on Node.js >=22.
6+
repository: https://github.com/your-username/flame-cli
7+
domains:
8+
- id: setup
9+
name: Project Setup & Configuration
10+
description: >
11+
Initializing flame in a Firebase project, configuring emulator vs remote
12+
mode, and setting up authentication. Developers encounter this domain
13+
when first installing flame and when switching between environments.
14+
concepts:
15+
- .flame.json config file
16+
- .firebaserc project detection
17+
- firebase.json emulator settings
18+
- flame init command
19+
- flame use command
20+
- useEmulator flag
21+
- Application Default Credentials (ADC)
22+
- FIRESTORE_EMULATOR_HOST env var
23+
- Firebase CLI dependency for emulators
24+
25+
- id: data-upload
26+
name: Uploading Documents
27+
description: >
28+
Writing documents to Firestore — single documents, collections from arrays,
29+
piped stdin, merge vs overwrite. The --idField flag is the most critical
30+
concept here and a common source of errors.
31+
concepts:
32+
- flame up command
33+
- document path vs collection path (even vs odd segments)
34+
- --idField flag
35+
- --data flag
36+
- --merge flag
37+
- stdin piping
38+
- array upload to collection
39+
- single doc to document path
40+
- single doc to collection path (requires --idField)
41+
- auto-generated IDs (collection.add)
42+
43+
- id: data-read
44+
name: Reading & Exporting Documents
45+
description: >
46+
Downloading documents and collections, using output for pipelines and
47+
backup workflows.
48+
concepts:
49+
- flame down command
50+
- --limit flag
51+
- --docId flag (_id field inclusion)
52+
- collection vs document path detection
53+
- JSON output format
54+
- stdout piping
55+
- pipeline-friendly mode (no spinner when piping)
56+
57+
- id: data-management
58+
name: Document Management
59+
description: >
60+
Copying, moving, and deleting documents. Move and copy are transactional.
61+
Delete requires confirmation unless --force is used, and prominently
62+
shows whether you are targeting EMULATOR or REMOTE.
63+
concepts:
64+
- flame delete / rm command
65+
- flame copy / cp command
66+
- flame move / mv command
67+
- flame collections command
68+
- --force flag (skip confirmation)
69+
- transactional move (source deleted only if destination write succeeds)
70+
- transactional copy
71+
- confirmation prompt showing EMULATOR vs REMOTE target
72+
- document-only constraint on copy/move
73+
74+
path_routing:
75+
rule: >
76+
ALL commands that accept a path use the same routing logic:
77+
even number of segments = document path, odd number = collection path.
78+
examples:
79+
- path: "users"
80+
segments: 1
81+
type: collection
82+
- path: "users/abc123"
83+
segments: 2
84+
type: document
85+
- path: "users/abc123/orders"
86+
segments: 3
87+
type: collection
88+
- path: "users/abc123/orders/order1"
89+
segments: 4
90+
type: document
91+
92+
failure_modes:
93+
- id: idfield-missing-collection-upload
94+
description: >
95+
Uploading a single document to a collection path without --idField throws
96+
"Must specify a document ID field with --idField!". Agents often omit
97+
--idField when the user hasn't mentioned it.
98+
severity: high
99+
100+
- id: array-to-document-path
101+
description: >
102+
Uploading a JSON array to a document path (even segments) logs an error
103+
about needing --idField and a collection path. The error is silent (no
104+
throw), so the command exits without writing anything.
105+
severity: high
106+
107+
- id: wrong-environment
108+
description: >
109+
Running write/delete commands while targeting remote Firestore when the
110+
developer intended the emulator (or vice versa). The delete command shows
111+
EMULATOR/REMOTE prominently in its confirmation prompt; up/down do not.
112+
Always verify with `flame status` before destructive operations against remote.
113+
severity: critical
114+
115+
- id: adc-not-configured
116+
description: >
117+
Remote mode always calls applicationDefault(). If ADC is not set up
118+
(`gcloud auth application-default login` not run), all commands against
119+
remote will fail with a credentials error. The emulator also calls
120+
applicationDefault() but the FIRESTORE_EMULATOR_HOST env var bypasses
121+
actual auth checks.
122+
severity: high
123+
124+
- id: idfield-value-undefined
125+
description: >
126+
If --idField is specified but the field is missing or undefined on a
127+
document in the array, the command throws "Document N does not have ID
128+
field X!". Every document in the array must contain the specified field.
129+
severity: medium
130+
131+
- id: copy-move-collection-paths
132+
description: >
133+
flame copy and flame move only accept document paths (even segments).
134+
Passing a collection path throws "Source and destination paths must be
135+
documents". There is no bulk copy/move.
136+
severity: medium
137+
138+
- id: delete-collection-not-recursive
139+
description: >
140+
flame delete on a collection path deletes only the direct documents in
141+
that collection. Subcollections are NOT deleted. Firestore subcollection
142+
documents will remain after the parent collection is cleared.
143+
severity: medium
144+
145+
- id: firebase-project-not-found
146+
description: >
147+
All commands require .firebaserc and firebase.json to be present in the
148+
working directory or a parent directory. Running flame outside a Firebase
149+
project directory fails with "No firebaserc file found!".
150+
severity: high

0 commit comments

Comments
 (0)