Commit Graph

224 Commits

Author SHA1 Message Date
CarmenDou 94c4706546 docs(cli): tag fenced wizard block as bash for markdownlint 2026-05-15 18:08:25 -07:00
CarmenDou f57c4f9a70 docs(cli): clarify dual-OAuth project-mismatch recovery is wizard-only 2026-05-15 17:47:18 -07:00
CarmenDou 7728580b4b docs(cli): drop ! prefix from common-mistakes wizard row 2026-05-15 17:09:36 -07:00
CarmenDou 7f7b127cb9 docs(cli): drop ! prefix suggestion, wizard needs real terminal 2026-05-15 17:07:05 -07:00
CarmenDou 16c3a6f8a7 docs(cli): clarify which posthog step needs human TTY 2026-05-15 17:03:23 -07:00
CarmenDou 96ff9a7538 docs(cli): reflect wizard handoff, add agent-facing TTY warning 2026-05-15 16:41:49 -07:00
CarmenDou 8fdaa5de8e docs(cli): restore phc_ workaround guard, fix beta wording, address greptile review 2026-05-15 07:25:40 -07:00
CarmenDou 564dad95a2 docs(cli): rewrite posthog setup reference for @posthog/wizard delegation 2026-05-14 17:49:17 -07:00
CarmenDou 7b3434d568 docs(cli): mirror payments availability pattern in posthog reference
Add a dedicated `## Availability` section to references/posthog.md and
expand the SKILL.md callout to a three-line block (feature + 404
failure mode + supported frameworks), matching the structure used for
payments. Tells agents what to do when the rollout hasn't reached the
project, and warns against working around the gap by pulling a phc_
key from a separate PostHog account.
2026-05-06 14:31:34 -07:00
CarmenDou c2e34a4688 fix(cli): use npx form in posthog reference, drop dead link
Address review feedback: replace bare `insforge ...` with
`npx @insforge/cli ...` per the skill's "no global install" rule.
Title also normalized to `# npx @insforge/cli posthog setup` to match
other reference files (login.md, db-query.md, payments.md, etc.).

Drop the Related link pointing to insforge-integrations/posthog.md —
that file doesn't exist on main.
2026-05-06 14:01:22 -07:00
CarmenDou 0711b787c5 feat(cli): add posthog command reference
Adds a new "Analytics Integration" command section to the InsForge CLI
skill, with a dedicated reference covering the templated SDK install
flow: framework auto-detection, per-framework templates (Next.js App/
Pages Router, Vite + React, SvelteKit, Astro), env var writes, and
the layout.tsx hand-off note.

Bumps insforge-cli skill to 1.4.0.
2026-05-06 13:47:43 -07:00
jfeng 4c5aa39b1e Merge pull request #54 from InsForge/feat/branching
INS-129 Feat/branching
2026-05-06 13:42:01 -07:00
Tony Chang da0879f1f3 Merge pull request #44 from InsForge/docs/better-auth-integration
Add Better Auth integration: guide + Next.js & Vite/React skeletons
2026-05-06 13:27:34 -07:00
Lyu b791181f2c Merge pull request #60 from InsForge/skills-enhancement
Improve InsForge SDK auth, payments, and realtime docs
2026-05-06 13:20:17 -07:00
Lyu 3a4d65e78a address comments 2026-05-06 13:19:48 -07:00
Lyu 49ce21038d optimize skills 2026-05-06 13:08:46 -07:00
yaowenc2 e2483c5292 docs(better-auth): rewrite for better_auth schema model — drop REVOKE
Templates moved BA's tables to a dedicated `better_auth` schema
(insforge-templates#28). The doc was still teaching the old
public+REVOKE model; sync it.

Removed:
- Entire "Lock down PostgREST exposure (REQUIRED)" section (15 lines).
- "DATABASE_URL must keep superuser-grade privileges" callout — no
  more REVOKE means no risk of a tightened DATABASE_URL silently
  breaking sign-up.
- Organization plugin REVOKE block (5-line SQL + verify curl text).
- Plugin REVOKE template table — every plugin's tables inherit
  `search_path=better_auth` automatically.
- Two Common Mistakes rows: "Skipping the REVOKE block" and
  "Connecting BA as anon/authenticated after REVOKE" — both no
  longer applicable.

Replaced with:
- Three-line schema-layout intro at the top of the guide showing
  auth.* / better_auth.* / public.* ownership.
- "Schema setup + first migrate" subsection with `CREATE SCHEMA`
  one-liner + a callout explaining why this is sufficient (PostgREST
  exposes only `public` by default; dashboard reaches `better_auth`
  through the admin route's postgres superuser pool).
- New `lib/auth.ts` example with `pool.on('connect')` setting
  `search_path TO better_auth, public` — the canonical pg method
  per BA's own docs since pg.Pool doesn't take a schema option.
- New Common Mistakes rows: forgetting `CREATE SCHEMA` before
  migrate; FK'ing without schema qualification.

Updated:
- Manual-integration numbered workflow: drop the REVOKE step,
  insert the CREATE SCHEMA step.
- FK example in the database-setup section: `REFERENCES public."user"(id)`
  → `REFERENCES better_auth."user"(id)`.
- "FK to BA users" section: prescribed FK is now `better_auth.user(id)`
  (not `public.user(id)`).
- Plugin section's "rule of thumb": `\dt better_auth.*` (not `public.*`).
- All REVOKE-template SQL in plugin sections — gone.

Net change: 96 lines edited (48 insertions, 48 deletions). Word count
4260 → 4482 (+5%) because the explanatory schema-layout + new Common
Mistakes rows are slightly longer than the dropped sections; acceptable
for the clarity gain.

Verified end-to-end against current insforge main (v2.1.0) via
insforge-templates#28's branch — see that PR for the test matrix.
2026-05-06 10:34:46 -07:00
Lyu d46f59a3a7 Merge pull request #59 from InsForge/payments-2
Address payment PR comment
2026-05-06 00:36:43 -07:00
Lyu 0387eaf36e address comment 2026-05-06 00:30:45 -07:00
yaowenc2 8b1551ae88 docs(better-auth): apply writing-skills REFACTOR — close gaps surfaced by RED/GREEN tests
Ran the writing-skills TDD methodology against the BA integration guide:
dispatched a baseline subagent to do the integration with no doc access
(RED), then a second subagent reading the doc (GREEN). Compared their
outputs to identify what the doc teaches well vs where it has gaps.

The doc PASSED retrieval testing — the GREEN agent produced correct
bridge route, REVOKE matrix, and requesting_user_id() helper just by
reading the relevant sections. But three real issues surfaced:

1. Hono bridge example contradicted the Next bridge on PII. The Next
   route's comment says "Don't add email or other PII"; the Hono one
   inlined `email: session.user.email` 400 lines later. GREEN agent
   flagged this as an internal contradiction. Removed the email claim,
   added a back-reference to the Next route's no-PII comment, and
   added the same `Cache-Control: no-store` header for parity.

2. The "DATABASE_URL must keep superuser-grade privileges" warning was
   buried in the Common Mistakes table near the bottom. Promoted it
   into a callout immediately under the REVOKE block, where the foot-
   gun actually fires (a user who tightens DATABASE_URL to the
   `authenticated` role after the REVOKE silently breaks BA sign-up).

3. The doc taught `requireEnv()` as the canonical pattern at lines
   60-66 but used `process.env.X!` 12 times after on the SERVER side
   — internal inconsistency a junior copy-paster would inherit.
   Standardized server-side reads on `requireEnv`. Kept `!` for
   `NEXT_PUBLIC_*` (those are bundler-inlined; a module-load check
   would just fire in the browser anyway) and added a one-line
   comment near the requireEnv definition explaining the asymmetry.

Also tightened `skills/insforge-integrations/SKILL.md` description:
dropped the workflow-summary tail ("Covers provider-specific dashboard
setup, client/server code…") since per writing-skills CSO guidance, a
description that summarizes the body trains Claude to read the
description and skip the actual content. The description now states
only when to use the skill.
2026-05-05 19:09:08 -07:00
Lyu 2b95534138 Merge pull request #58 from InsForge/payments-2 2026-05-05 19:04:11 -07:00
yaowenc2 c9ee86a903 docs(better-auth): drop examples/better-auth-react in favor of inline doc snippets
The Vite/React skeleton was demonstrating the same Vite-proxy +
Origin-rewrite pattern that's already documented in prose with full
code blocks (the "Vite / React-only setups" section, ~109 lines
including a complete vite.config.ts and Hono bridge route).

Same drift logic that retired examples/better-auth-nextjs: no
CLI/CI keeps the example accurate, every @insforge/sdk or BA bump
risks a stale snippet. The doc IS the canonical reference.

If a real "clone-and-run" Vite story becomes worth the maintenance,
ship it through the CLI: a `vite` base template + the existing
better-auth overlay, same model as nextjs.

PR #44 is now 2 files: the SKILL.md edit and the integration guide.
2026-05-05 19:02:23 -07:00
yaowenc2 15beec29e2 Merge remote-tracking branch 'origin/main' into docs/better-auth-integration
# Conflicts:
#	skills/insforge-integrations/SKILL.md
2026-05-05 18:59:31 -07:00
yaowenc2 0c6648d45f docs(better-auth): drop examples/better-auth-nextjs in favor of CLI scaffold
The Next skeleton was duplicating what `insforge create --auth
better-auth` (CLI #98) and the templates repo's auth-providers/
better-auth/ overlay produce. We just had drift between the two
copies — the project_admin REVOKE fix had to land twice — so the
duplication is real maintenance cost.

Drop the Next skeleton entirely; point the doc at the CLI command
instead. Vite/React skeleton stays — the CLI doesn't scaffold React
yet, so it's still the canonical reference for that pattern.

Reduces this PR from 33 files to 13.
2026-05-05 18:59:07 -07:00
Lyu eac3ef0578 update payments skills 2026-05-05 18:43:16 -07:00
yaowenc2 17236a21d0 docs(better-auth): include project_admin in REVOKE — Studio path is role-independent
The dashboard's record browser switched from /database/records (PostgREST
passthrough, runs as the project_admin Postgres role) to
/database/admin/tables/.../records (backend AdminRecordService → postgres
superuser pool). Studio inspection is now role-independent, so the
"REVOKE from project_admin only if you want full lockdown" caveat was
misleading — there's no trade-off, just REVOKE from it.

Updated the core REVOKE block, the Organization plugin block, and the
plugin REVOKE-template table.
2026-05-05 17:46:18 -07:00
jwfing 6502e568a0 add description for error case. 2026-05-05 13:33:10 -07:00
jwfing 8547f2ee9e merge main 2026-05-05 13:24:39 -07:00
Tony Chang bffc4f4a54 Merge pull request #57 from InsForge/chore/claude-plugins-marketplace-manifest
chore: add Claude Code plugin manifest and align skill licenses
2026-05-05 11:23:31 -07:00
yaowenc2 c0ff5080fa chore: align manifest with official InsForge tagline
Replaces the description with the canonical InsForge positioning:
"The backend platform for AI-native developers. A Postgres-based
backend with auth, storage, compute, hosting, and AI gateway. Built
for coding agents."

Updates keywords to match the surface area called out in the tagline
(postgres, auth, storage, compute, hosting, ai-gateway) and swaps
agent-native for ai-native / coding-agents to mirror the marketing copy.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-05 11:18:19 -07:00
yaowenc2 63162cee53 chore: lead manifest description with agent-native positioning
Reframes the plugin description so the InsForge value prop — agent-native
BaaS for agent-native builders — is the first thing a marketplace browser
sees, before the feature list. Adds agent-native and ai-agents keywords
to improve discoverability for builders searching the directory.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-05 11:17:43 -07:00
yaowenc2 20f63b7e25 chore: add Claude Code plugin manifest and align skill licenses
Adds .claude-plugin/plugin.json so this repo can be submitted to the
official Claude Code plugin marketplace
(anthropics/claude-plugins-official) via the in-app submission form at
claude.ai/settings/plugins/submit.

Also aligns the license field across the three SKILL.md files that
declared Apache-2.0 to MIT, matching the LICENSE file at the repo root
and avoiding inconsistency a marketplace reviewer would flag.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-05 11:15:48 -07:00
Tony Chang 4c214debe9 Merge pull request #56 from InsForge/oauth-consent-screen-branding
Document OAuth consent screen branding (shared keys vs. custom)
2026-05-05 10:43:25 -07:00
yaowenc2 b491dce2f5 document OAuth consent screen branding
Clarify what end users see on Google's sign-in screen with shared keys
(insforge.dev) vs. custom credentials (insforge.app) and what the project
owner needs to do in each case to rebrand.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-05 10:40:36 -07:00
jwfing 8188513d34 sync branch quota numbers with backend defaults
Backend defaults dropped to maxBranchedParentsPerOrg=3 and
maxBranchesPerParent=2 (theoretical cap 6 branches/org instead of 15).
Update the user-facing copy in branch.md to match.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-04 18:26:05 -07:00
jwfing 1a1980a45b consolidate branch reference docs
Collapse five thin per-subcommand branch references (create, list, switch,
delete, when-to-use) into a single branch.md covering the decision guide
and lifecycle commands. Trim duplicated post-merge and reset-vs-delete
content from branch-merge.md and branch-reset.md, and update SKILL.md
links accordingly.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-04 11:11:28 -07:00
jwfing 63058dd46c modify branch command within insforge-cli 2026-05-01 17:52:35 -07:00
jwfing 6ea7b2ea35 merge main 2026-05-01 17:37:38 -07:00
yaowenc2 ba18c08d8c fix(better-auth): client.setAccessToken not in published SDK 1.2.6
Critical correction. The published @insforge/sdk@1.2.6 does NOT
expose client.setAccessToken on the public client class — only on
TokenManager. Both example skeletons were calling client.setAccessToken
directly, which would throw "is not a function" at runtime. The CLI
scaffold was already correct (feature-detect helper); the standalone
example skeletons were not.

Verified by importing the published 1.2.6 SDK directly:
  client.setAccessToken            → undefined
  client.getHttpClient().setAuthToken → function
  client.realtime.tokenManager.setAccessToken → function

Changes:
- Both skeleton lib/insforge.ts files now use the same setBridgeToken
  helper the CLI scaffold uses (feature-detects so it stays correct
  when public method ships in 1.3.0)
- Skill doc Pattern A code block adopts the helper; the explanatory
  note is rewritten to match reality (1.3.0 ships public method,
  1.2.x needs dual-update)
- Sign-out section, Realtime section, and Common Mistakes table
  entry all reference the helper instead of the non-existent
  public method
- React skeleton README updated

Verified post-fix end-to-end on ba-sdk-test: Vite SPA signup → bridge
JWT → RLS-scoped INSERT all green with the corrected helper.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-01 17:14:21 -07:00
yaowenc2 f61fe9a99a docs(better-auth): pin SDK to ^1.2.6 (the actual published version)
@insforge/sdk@1.3.0 doesn't exist on npm — the latest published
version is 1.2.6, which already includes the public setAccessToken
API the skeletons depend on. Both example skeletons' package.json
were failing npm install on the stale ^1.3.0 pin.

Also flips every "SDK ≥ 1.3.0" reference in the skill doc and
example READMEs to 1.2.6 so the version threshold matches reality.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-01 16:40:43 -07:00
yaowenc2 08cb6370ec docs(better-auth): lead with CLI quick-start, demote manual to inline reference
The Recommended Workflow section now leads with the four-line CLI flow
(link → install → setup → dev) and frames the rest of the doc as a
reference layer: what got scaffolded, why, and how to extend it.
Manual workflow stays as a one-paragraph callout for users who can't
or won't use the CLI, with each numbered step still anchored to its
own section below.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-01 16:16:21 -07:00
yaowenc2 c39c429652 docs(better-auth): point cold-path users at better-auth/skills
If a user lands on this guide without BA already configured, give them
two paths: the InsForge CLI flag (one-shot) for users in our flow, or
better-auth/skills (the canonical BA scaffolder) for users coming from
outside. This skill covers the InsForge integration layer, not generic
Better Auth setup, so we shouldn't reinvent the BA scaffolder.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-01 16:12:24 -07:00
Lyu c6052ac54d Merge pull request #53 from InsForge/explain-service-role-key
INS-118 Mention api key service role key equivalence
2026-05-01 13:28:25 -07:00
Lyu 8adecdd64a address comment 2026-05-01 13:27:58 -07:00
Lyu fc4278d9ff mention api key service role key equivalence 2026-05-01 13:20:05 -07:00
Lyu aecbc109d1 Merge pull request #52 from InsForge/enhance-payment-skills
refine payment skills
2026-05-01 00:06:35 -07:00
Lyu e173486250 refine payment skills 2026-05-01 00:04:22 -07:00
Tony Chang dcbab6097e Merge pull request #51 from InsForge/refactor/compute-events-rename
refactor(insforge-cli): rename `compute logs` to `compute events` in SKILL
2026-04-30 16:18:45 -07:00
yaowenc2 e07e485399 refactor(insforge-cli): rename compute logs to compute events in SKILL
Tracks the parallel CLI rename: the underlying OSS endpoint surfaces
Fly machine lifecycle events (start/stop/exit/restart), not container
stdout/stderr. The new command name is honest about that.

`compute logs` will return as a separate command for actual container
stdout/stderr streaming when that feature lands.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-30 16:18:00 -07:00
yaowenc2 ea49c60014 docs(better-auth): address 4 CodeRabbit nits without bloat
- Add `CREATE EXTENSION IF NOT EXISTS pgcrypto` before gen_random_uuid()
  so the SQL block runs on a fresh DB. Idempotent on existing stacks.
- Validate the bridged token before piping it into setAccessToken so a
  malformed bridge response throws cleanly instead of silently clearing
  auth state.
- Narrow the React effect dep from session.data?.user to
  session.data?.user?.id — avoids resetting the refresh interval if the
  auth library returns a new user object instance with the same id.
- Pattern B: pass explicit { algorithm: 'HS256', expiresIn: '1h' } to
  jwt.sign and drop the manual exp claim. Aligns with the bridge route
  and the service-token mailer.

CodeRabbit also flagged HTML escaping in the email-template snippet.
Skipping that — production code should use react-email/mjml; for an
example demonstrating client.emails.send, a 7-line escape helper is
more noise than the snippet's worth.

Re-ran the 12-check Next.js e2e: signup → bridge → RLS isolation → REVOKE
→ sign-out, all green.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-30 15:21:50 -07:00