procedure-cli 1.3.0 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -1
- package/config/stacks/android-kotlin-compose.json +17 -0
- package/config/stacks/flutter.json +17 -0
- package/config/stacks/ionic-capacitor.json +16 -0
- package/config/stacks/react-native-bare.json +17 -0
- package/config/stacks/swift-ios.json +17 -0
- package/dist/app.js +18 -1
- package/dist/app.js.map +1 -1
- package/dist/lib/architecture.d.ts +15 -0
- package/dist/lib/architecture.js +142 -0
- package/dist/lib/architecture.js.map +1 -0
- package/dist/lib/template.js +41 -0
- package/dist/lib/template.js.map +1 -1
- package/dist/lib/types.d.ts +3 -0
- package/dist/steps/architecture.d.ts +3 -1
- package/dist/steps/architecture.js +6 -23
- package/dist/steps/architecture.js.map +1 -1
- package/dist/steps/product-context.js +92 -22
- package/dist/steps/product-context.js.map +1 -1
- package/dist/steps/stack-style.js +173 -15
- package/dist/steps/stack-style.js.map +1 -1
- package/package.json +1 -1
- package/templates/AGENTS.md.hbs +18 -11
- package/templates/CLAUDE.md.hbs +64 -8
- package/templates/deployment/00-README.md.hbs +38 -0
- package/templates/gitignore.hbs +43 -0
- package/templates/skills/assets/CODE-FIXED.template.md +1 -1
- package/templates/skills/b3awesome-code-fix/SKILL.md +2 -2
- package/templates/skills/b3awesome-code-review/SKILL.md +1 -1
package/templates/AGENTS.md.hbs
CHANGED
|
@@ -7,11 +7,11 @@ This file provides tool-agnostic instructions for AI coding agents working on th
|
|
|
7
7
|
## Build & Test
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
|
-
{{buildCommand}} # Build
|
|
11
|
-
{{typecheckCommand}} # Typecheck
|
|
12
|
-
{{testCommand}} # Run tests
|
|
13
|
-
{{lintCommand}} # Lint
|
|
14
|
-
{{prCommand}} # Pre-PR checks
|
|
10
|
+
{{{buildCommand}}} # Build
|
|
11
|
+
{{{typecheckCommand}}} # Typecheck
|
|
12
|
+
{{{testCommand}}} # Run tests
|
|
13
|
+
{{{lintCommand}}} # Lint
|
|
14
|
+
{{{prCommand}}} # Pre-PR checks
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
Run typecheck before build. Run all checks before submitting a PR.
|
|
@@ -62,16 +62,23 @@ When a user reports a bug:
|
|
|
62
62
|
|
|
63
63
|
## Understanding, Planning & Approval
|
|
64
64
|
|
|
65
|
-
-
|
|
66
|
-
-
|
|
65
|
+
- Confirm understanding and present the approach in Vietnamese before implementing
|
|
66
|
+
- Code, identifiers, comments, commit messages, and committed docs stay in English
|
|
67
67
|
- Always wait for the user's approval on the understanding and the approach
|
|
68
68
|
- Make a task after being approved
|
|
69
69
|
|
|
70
|
+
## Documentation Sync
|
|
71
|
+
|
|
72
|
+
- After EVERY implementation: update CLAUDE.md, README.md, and product artifacts (docs/PRD.md, docs/USER-STORIES.md) to reflect the current state
|
|
73
|
+
- **AGENTS.md must always stay in sync with CLAUDE.md** — CLAUDE.md is the source of truth. After any change to CLAUDE.md, propagate relevant updates to AGENTS.md immediately
|
|
74
|
+
- Architecture descriptions, step counts, component lists, and behavioral descriptions must match the actual code
|
|
75
|
+
- Never leave docs describing removed features, old step numbers, or stale behavior
|
|
76
|
+
|
|
70
77
|
## Testing
|
|
71
78
|
|
|
72
|
-
1. Run `{{typecheckCommand}}` — must pass with no errors
|
|
73
|
-
2. Run `{{testCommand}}` — all tests must pass
|
|
74
|
-
3. Run `{{lintCommand}}` — no lint violations
|
|
79
|
+
1. Run `{{{typecheckCommand}}}` — must pass with no errors
|
|
80
|
+
2. Run `{{{testCommand}}}` — all tests must pass
|
|
81
|
+
3. Run `{{{lintCommand}}}` — no lint violations
|
|
75
82
|
|
|
76
83
|
When adding new functionality, add corresponding tests. When fixing a bug, add a regression test.
|
|
77
84
|
|
|
@@ -80,7 +87,7 @@ When adding new functionality, add corresponding tests. When fixing a bug, add a
|
|
|
80
87
|
- Keep commits focused — one logical change per commit
|
|
81
88
|
- Write descriptive commit messages explaining **why**, not just what
|
|
82
89
|
- After any implementation change, verify that documentation (README.md, docs/PRD.md, docs/USER-STORIES.md) still reflects the current state
|
|
83
|
-
- Run `{{prCommand}}` before opening a PR
|
|
90
|
+
- Run `{{{prCommand}}}` before opening a PR
|
|
84
91
|
|
|
85
92
|
## Security
|
|
86
93
|
|
package/templates/CLAUDE.md.hbs
CHANGED
|
@@ -7,12 +7,13 @@ See docs/PRD.md for product requirements and docs/USER-STORIES.md for user stori
|
|
|
7
7
|
## Build & Test
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
|
-
{{buildCommand}} # Build
|
|
11
|
-
{{typecheckCommand}} # Typecheck (fast — run first)
|
|
12
|
-
{{
|
|
13
|
-
{{testCommand}} # Test (full suite)
|
|
14
|
-
{{
|
|
15
|
-
{{
|
|
10
|
+
{{{buildCommand}}} # Build
|
|
11
|
+
{{{typecheckCommand}}} # Typecheck (fast — run first)
|
|
12
|
+
{{{testCommandFiltered}}} # Test (specific)
|
|
13
|
+
{{{testCommand}}} # Test (full suite)
|
|
14
|
+
{{#if e2eTestCommand}}{{{e2eTestCommand}}} # E2E tests
|
|
15
|
+
{{/if}}{{{lintCommand}}} # Lint
|
|
16
|
+
{{{prCommand}}} # Before creating a PR
|
|
16
17
|
```
|
|
17
18
|
|
|
18
19
|
## Documentation Lookup
|
|
@@ -30,6 +31,58 @@ See docs/PRD.md for product requirements and docs/USER-STORIES.md for user stori
|
|
|
30
31
|
|
|
31
32
|
{{{architecture}}}
|
|
32
33
|
|
|
34
|
+
{{#contains techStack "Supabase"}}
|
|
35
|
+
## Auth & RLS
|
|
36
|
+
|
|
37
|
+
This project uses Supabase. Key rules:
|
|
38
|
+
|
|
39
|
+
- **Defense in depth**: every gated mutation is checked at three layers — UI visibility, server-route helpers, and DB-level RLS policies. Never rely on a single layer.
|
|
40
|
+
- **RLS-first**: every new table needs an RLS policy in the same migration. `authenticated` SELECT and owner-scoped INSERT/UPDATE/DELETE are the default; widen explicitly.
|
|
41
|
+
- **Server vs client**: use `@supabase/ssr` for server components and route handlers; `@supabase/supabase-js` for client components. Never mix sessions across the boundary.
|
|
42
|
+
- **Mutations must be awaited**: `supabase.from(...).update(...).eq(...)` returns a lazy thenable — a bare statement is a silent no-op. Always `await` or `.then()`.
|
|
43
|
+
{{/contains}}
|
|
44
|
+
{{#contains techStack "Upstash"}}
|
|
45
|
+
## Rate-limiting
|
|
46
|
+
|
|
47
|
+
Rate limits are enforced via Upstash Redis (`@upstash/ratelimit`). When adding a new endpoint:
|
|
48
|
+
|
|
49
|
+
- Pick the right tier: public unauthenticated routes ≤ 10/min/IP, authenticated reads ≤ 600/min, mutations ≤ 120/min.
|
|
50
|
+
- Fail-open if Upstash env vars are absent — never block production traffic on a missing credential.
|
|
51
|
+
- Emit `security.rate_limited` audit events for tripped limits.
|
|
52
|
+
{{/contains}}
|
|
53
|
+
{{#contains techStack "MCP SDK"}}
|
|
54
|
+
## MCP Tools
|
|
55
|
+
|
|
56
|
+
This project exposes Model Context Protocol tools via `@modelcontextprotocol/sdk`. Conventions:
|
|
57
|
+
|
|
58
|
+
- Tool definitions live in `src/mcp/tools/` — one file per tool, default-exporting `{ name, description, inputSchema, handler }`.
|
|
59
|
+
- Server entry point in `src/mcp/server.ts` registers all tools and wires transport.
|
|
60
|
+
- Document each tool's `name`, args, and side effects in this section as you add them — agents discover tools by name only.
|
|
61
|
+
{{/contains}}
|
|
62
|
+
{{#contains techStack "Vercel"}}
|
|
63
|
+
## Deployment
|
|
64
|
+
|
|
65
|
+
Deployment runbook lives in [`deployment/`](./deployment/). Single source of truth for:
|
|
66
|
+
|
|
67
|
+
- Env-var matrix (`deployment/01-env-vars.md`)
|
|
68
|
+
- Vercel project settings & domains (`deployment/02-vercel-checklist.md`)
|
|
69
|
+
- Migration log
|
|
70
|
+
- Preflight script run before infra-affecting commits
|
|
71
|
+
|
|
72
|
+
Update `deployment/` **in the same commit** as any infrastructure change.
|
|
73
|
+
{{else}}{{#contains techStack "Fly.io"}}
|
|
74
|
+
## Deployment
|
|
75
|
+
|
|
76
|
+
Deployment runbook lives in [`deployment/`](./deployment/) — Fly.io app config (`fly.toml`), env-var matrix, release commands. Update `deployment/` in the same commit as any infra change.
|
|
77
|
+
{{else}}{{#contains techStack "Railway"}}
|
|
78
|
+
## Deployment
|
|
79
|
+
|
|
80
|
+
Deployment runbook lives in [`deployment/`](./deployment/) — Railway service config, env-var matrix, migration log. Update `deployment/` in the same commit as any infra change.
|
|
81
|
+
{{else}}{{#contains techStack "Cloudflare"}}
|
|
82
|
+
## Deployment
|
|
83
|
+
|
|
84
|
+
Deployment runbook lives in [`deployment/`](./deployment/) — Cloudflare Workers config (`wrangler.toml`), env-var matrix, secret bindings. Update `deployment/` in the same commit as any infra change.
|
|
85
|
+
{{/contains}}{{/contains}}{{/contains}}{{/contains}}
|
|
33
86
|
{{#if (eq framework "Ink")}}
|
|
34
87
|
## Ink TUI Development
|
|
35
88
|
|
|
@@ -88,14 +141,15 @@ All colors accessed through `C` from `src/lib/theme.ts`. **Never hardcode hex va
|
|
|
88
141
|
- A good plan lets you one-shot the implementation
|
|
89
142
|
|
|
90
143
|
### Understanding, Planning & Approval
|
|
91
|
-
-
|
|
92
|
-
-
|
|
144
|
+
- Confirm understanding and present the approach in Vietnamese before implementing
|
|
145
|
+
- Code, identifiers, comments, commit messages, and committed docs stay in English
|
|
93
146
|
- Always wait for the user's approval on the understanding and the approach
|
|
94
147
|
- Make a task after being approved
|
|
95
148
|
- Leverage team agents if possible
|
|
96
149
|
|
|
97
150
|
### Documentation Sync
|
|
98
151
|
- After EVERY implementation: update CLAUDE.md, README.md, and product artifacts (docs/PRD.md, docs/USER-STORIES.md) to reflect the current state
|
|
152
|
+
- **AGENTS.md must always stay in sync with CLAUDE.md** — CLAUDE.md is the source of truth. After any change to CLAUDE.md, propagate relevant updates to AGENTS.md immediately
|
|
99
153
|
- Architecture descriptions, step counts, component lists, and behavioral descriptions must match the actual code
|
|
100
154
|
- Never leave docs describing removed features, old step numbers, or stale behavior
|
|
101
155
|
|
|
@@ -176,6 +230,7 @@ When a user reports a bug:
|
|
|
176
230
|
2. **If valid** — append a new `CR-` entry to `CODE-REVIEW.md` following the code review logging procedure (Entry ID, Scope, Validation Matrix, Findings with `file:line` evidence and severity, Verification Notes).
|
|
177
231
|
3. **If not valid** — explain to the user why the reported behavior is expected or not reproducible.
|
|
178
232
|
|
|
233
|
+
{{#if hasReleaseScript}}
|
|
179
234
|
## Release
|
|
180
235
|
|
|
181
236
|
```bash
|
|
@@ -190,6 +245,7 @@ The release script (`~/bin/{{projectName}}-release`) will:
|
|
|
190
245
|
3. Bump version via `npm version`
|
|
191
246
|
4. Push branch + tags to origin
|
|
192
247
|
5. Publish to registry
|
|
248
|
+
{{/if}}
|
|
193
249
|
|
|
194
250
|
## Core Principles
|
|
195
251
|
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Deployment — {{projectName}}
|
|
2
|
+
|
|
3
|
+
Single source of truth for shipping {{projectName}} to **{{deployTarget}}**. After any infrastructure-affecting change, update the relevant file in this folder **in the same commit** as the code.
|
|
4
|
+
|
|
5
|
+
## Files in this folder
|
|
6
|
+
|
|
7
|
+
| File | Purpose |
|
|
8
|
+
|------|---------|
|
|
9
|
+
| `00-README.md` | This index — overview and update protocol |
|
|
10
|
+
| `01-env-vars.md` | Env-var matrix (name, scope, source, rotation) |
|
|
11
|
+
| `02-{{deployTarget}}-checklist.md` | Provider-specific deploy checklist |
|
|
12
|
+
| `05-migrations.md` | DB migration log (append-only) |
|
|
13
|
+
| `07-scripts/01-preflight.sh` | Local preflight: typecheck + lint + build + env audit |
|
|
14
|
+
|
|
15
|
+
## Update protocol
|
|
16
|
+
|
|
17
|
+
1. **Add or rename an env var** → update `01-env-vars.md`, `02-{{deployTarget}}-checklist.md`, and `.env.example` in the same commit.
|
|
18
|
+
2. **New migration** → append to `05-migrations.md`. Bump any generated DB types.
|
|
19
|
+
3. **New third-party integration** → add to `02-{{deployTarget}}-checklist.md` plus an integration-specific doc.
|
|
20
|
+
4. **Change preflight or release scripts** → the script file itself + reference here.
|
|
21
|
+
|
|
22
|
+
## Preflight
|
|
23
|
+
|
|
24
|
+
Run `bash deployment/07-scripts/01-preflight.sh` before pushing infra-touching commits. It exercises typecheck, lint, build, and the env audit. CI runs the same script — if it fails locally, it will fail in CI.
|
|
25
|
+
|
|
26
|
+
{{#contains techStack "Supabase"}}
|
|
27
|
+
## Supabase notes
|
|
28
|
+
|
|
29
|
+
- Migrations live in `supabase/migrations/` — apply with `supabase db push` against the linked project.
|
|
30
|
+
- Auth URL allowlist must be updated in the Supabase dashboard whenever a new domain is added.
|
|
31
|
+
- RLS policies are part of the migration file that creates the table — never enable RLS in a separate commit.
|
|
32
|
+
{{/contains}}
|
|
33
|
+
{{#contains techStack "Upstash"}}
|
|
34
|
+
## Upstash notes
|
|
35
|
+
|
|
36
|
+
- Rate-limit env vars: `UPSTASH_REDIS_REST_URL`, `UPSTASH_REDIS_REST_TOKEN`.
|
|
37
|
+
- Rate-limit code is fail-open: if env vars are absent, requests pass through. Audit the `01-env-vars.md` matrix to confirm presence in every environment.
|
|
38
|
+
{{/contains}}
|
package/templates/gitignore.hbs
CHANGED
|
@@ -9,11 +9,54 @@ dist/
|
|
|
9
9
|
*.so
|
|
10
10
|
*.dylib
|
|
11
11
|
vendor/
|
|
12
|
+
{{else if (eq language "Kotlin")}}
|
|
13
|
+
# Android / Kotlin
|
|
14
|
+
build/
|
|
15
|
+
.gradle/
|
|
16
|
+
local.properties
|
|
17
|
+
*.iml
|
|
18
|
+
.idea/
|
|
19
|
+
captures/
|
|
20
|
+
.cxx/
|
|
21
|
+
{{else if (eq language "Dart")}}
|
|
22
|
+
# Flutter / Dart
|
|
23
|
+
.dart_tool/
|
|
24
|
+
.flutter-plugins
|
|
25
|
+
.flutter-plugins-dependencies
|
|
26
|
+
.packages
|
|
27
|
+
.pub-cache/
|
|
28
|
+
.pub/
|
|
29
|
+
build/
|
|
30
|
+
ios/Pods/
|
|
31
|
+
ios/.symlinks/
|
|
32
|
+
android/.gradle/
|
|
33
|
+
android/local.properties
|
|
34
|
+
*.g.dart
|
|
35
|
+
*.freezed.dart
|
|
36
|
+
{{else if (eq language "Swift")}}
|
|
37
|
+
# Swift / Xcode
|
|
38
|
+
build/
|
|
39
|
+
DerivedData/
|
|
40
|
+
*.xcuserstate
|
|
41
|
+
*.xcworkspace/xcuserdata/
|
|
42
|
+
xcuserdata/
|
|
43
|
+
.swiftpm/
|
|
44
|
+
Pods/
|
|
12
45
|
{{else}}
|
|
13
46
|
# Node.js
|
|
14
47
|
node_modules/
|
|
15
48
|
dist/
|
|
16
49
|
*.tsbuildinfo
|
|
50
|
+
{{#if (eq framework "Ionic")}}
|
|
51
|
+
# Ionic / Capacitor
|
|
52
|
+
www/
|
|
53
|
+
.sourcemaps/
|
|
54
|
+
ios/App/Pods/
|
|
55
|
+
ios/App/build/
|
|
56
|
+
android/app/build/
|
|
57
|
+
android/.gradle/
|
|
58
|
+
android/build/
|
|
59
|
+
{{/if}}
|
|
17
60
|
{{/if}}
|
|
18
61
|
|
|
19
62
|
# Environment
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
- Each finding is referenced as `Finding #N (Severity)` matching the review's numbering.
|
|
8
8
|
- Fixed findings must include `file:line` for every change made.
|
|
9
9
|
- Deferred findings must include rationale and a revisit trigger.
|
|
10
|
-
- Verification section must confirm
|
|
10
|
+
- Verification section must confirm the project's typecheck + build commands (see the Build & Test section in `CLAUDE.md`) pass after fixes.
|
|
11
11
|
- Language: English only. Tone: Technical, concise, action-focused.
|
|
12
12
|
|
|
13
13
|
### Entry ID Convention
|
|
@@ -33,7 +33,7 @@ Each entry must include:
|
|
|
33
33
|
- `file:line` for every change made
|
|
34
34
|
- Brief description of the fix
|
|
35
35
|
- **Deferred**: findings not fixed, with rationale and revisit trigger
|
|
36
|
-
- **Verification Notes**: must confirm
|
|
36
|
+
- **Verification Notes**: must confirm the project's typecheck + build commands (see the Build & Test section in `CLAUDE.md`) pass after fixes
|
|
37
37
|
|
|
38
38
|
## Writing Standard
|
|
39
39
|
|
|
@@ -62,7 +62,7 @@ If `CODE-FIXED.md` does not exist in the project root, create it with this heade
|
|
|
62
62
|
- Each finding is referenced as `Finding #N (Severity)` matching the review's numbering.
|
|
63
63
|
- Fixed findings must include `file:line` for every change made.
|
|
64
64
|
- Deferred findings must include rationale and a revisit trigger.
|
|
65
|
-
- Verification section must confirm
|
|
65
|
+
- Verification section must confirm the project's typecheck + build commands (see Build & Test in `CLAUDE.md`) pass after fixes.
|
|
66
66
|
- Language: English only. Tone: Technical, concise, action-focused.
|
|
67
67
|
|
|
68
68
|
### Entry ID Convention
|
|
@@ -34,7 +34,7 @@ Each entry must include:
|
|
|
34
34
|
- `file:line` evidence
|
|
35
35
|
- Clear recommendation
|
|
36
36
|
- `Status`: `New`, `Still Open`, `Fixed`, `Regressed`, or `Not Reproducible`
|
|
37
|
-
- **Verification Notes**:
|
|
37
|
+
- **Verification Notes**: status of the project's typecheck / build commands (see the Build & Test section in `CLAUDE.md`)
|
|
38
38
|
- **Residual Risks / Testing Gaps**: known untested areas
|
|
39
39
|
|
|
40
40
|
## Writing Standard
|