Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
9e052e1
docs: add initial setup design spec for AINATIVEM-41
dmitriyeff May 8, 2026
ab19f42
docs: add implementation plan for AINATIVEM-41 CLI foundation
dmitriyeff May 8, 2026
b3e3c62
chore: initialize project scaffold
dmitriyeff May 8, 2026
85eeab6
chore: remove extra placeholder files from src/
dmitriyeff May 8, 2026
252d98b
chore: add .gitignore and untrack node_modules
dmitriyeff May 8, 2026
b83a875
ci: add GitHub Actions workflow for lint and test
dmitriyeff May 8, 2026
08356e7
feat: add GeneratorOptions and Generator interface
dmitriyeff May 8, 2026
d3b3a31
feat: add writeFile utility with prettier formatting
dmitriyeff May 8, 2026
e0424d7
fix: narrow writeFile catch to no-parser errors only
dmitriyeff May 8, 2026
c926756
feat: add projectName prompt
dmitriyeff May 8, 2026
6cbb05c
feat: add database prompt
dmitriyeff May 8, 2026
245822f
feat: add appExtensions prompt
dmitriyeff May 8, 2026
9a923f6
feat: add webhooks prompt
dmitriyeff May 8, 2026
da99a4e
fix: trim project name input
dmitriyeff May 8, 2026
f1bc3d6
feat: add oauth stub generator
dmitriyeff May 8, 2026
e9babef
feat: add database stub generator
dmitriyeff May 8, 2026
3ceec43
feat: add webhooks stub generator
dmitriyeff May 8, 2026
9800ce9
feat: add appExtensions stub generator
dmitriyeff May 8, 2026
36ffe6e
fix: revert trim on projectName, configure eslint to ignore _-prefixe…
dmitriyeff May 8, 2026
9424dbd
feat: add app.ts generator with conditional router logic
dmitriyeff May 8, 2026
21a6b84
feat: add node generator orchestrator with root project file generators
dmitriyeff May 8, 2026
b5628ca
feat: add php generator stub
dmitriyeff May 8, 2026
a8f7fe4
feat: add CLI entry point
dmitriyeff May 8, 2026
2c9457c
test: add end-to-end generator test with tsc --noEmit validation
dmitriyeff May 8, 2026
1480757
chore: exclude superpowers plans and specs from version control
dmitriyeff May 8, 2026
a1a469e
chore: remove dev script, run CLI locally with npx tsx src/cli.ts
dmitriyeff May 8, 2026
612c6bf
Potential fix for pull request finding
dmitriyeff May 11, 2026
2382a9a
AINATIVEM-41 co-pilot review adjustments
dmitriyeff May 11, 2026
77eed6a
AINATIVEM-41 pretify src files
dmitriyeff May 11, 2026
f67f24c
AINATIVEM-41 use native fs lib
dmitriyeff May 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: CI

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- run: npm ci
- run: npm run lint
Comment thread
dmitriyeff marked this conversation as resolved.
- run: npm run typecheck
- run: npm test
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
node_modules/
dist/
.env
docs/superpowers/

# locally generated test apps
*-app/
9 changes: 9 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"printWidth": 120,
"singleQuote": true,
"useTabs": true,
"tabWidth": 4,
"trailingComma": "all",
"quoteProps": "consistent",
"proseWrap": "always"
}
92 changes: 92 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

## Project Purpose

`create-pipedrive-app` is a CLI scaffolding tool for external Pipedrive Marketplace developers. It generates a production-ready integration project via `npx create-pipedrive-app <project-name>`.

## Architecture

The tool is **CLI-first**, with an **AI plugin layer** built on top:

- **CLI core**: Collects user choices via interactive prompts, then generates a project scaffold from templates.
- **AI plugin layer** (secondary): Claude/Codex skills that wrap the CLI — guide developers, modify existing projects, and explain generated code.

### Interactive prompts (CLI)

The CLI asks for:
- Backend: Node.js/Express, Node.js/Fastify, or PHP/Laravel
- Database: Postgres, MySQL, or SQLite
- App Extensions frontend: React, Vanilla JS, or none
- Webhooks: Yes/No
Comment on lines +18 to +22

### Generated project structure

```
<project-name>/
backend/
oauth/ # Authorization redirect, callback, token exchange, refresh, state validation
pipedrive-client/ # Official API client wrapper with preconfigured auth
database/ # Tenant/account mapping, tokens, scopes, installation status
webhooks/ # Optional webhook handlers
frontend/
app-extension-ui/ # Optional: React or Vanilla iframe UI with App Extensions SDK
.env.example
README.md
docker-compose.yml
marketplace-checklist.md
```

## MVP Scope

The initial implementation targets:
- **Runtime**: Node.js + TypeScript
- **Backend**: Express or Fastify
- **Database**: Postgres via Docker Compose
- **Auth**: Full OAuth 2.0 install/callback/token-refresh flow
- **API client**: Pipedrive Node.js client wrapper
- **Frontend** (optional): React App Extensions UI
- Outputs `.env.example` and a Marketplace readiness checklist

PHP and MySQL/SQLite backends come after MVP.

## Core Modules

### OAuth (`backend/oauth/`)
Full OAuth 2.0: app registration guidance, authorization redirect, callback handling, token exchange, token refresh, state validation.

### Database (`backend/database/`)
Uses **Drizzle ORM** (`drizzle-orm` + `drizzle-kit`) for schema definition and migrations. Drizzle is chosen because it supports Postgres, MySQL, and SQLite with the same TypeScript API — matching the three database options the CLI offers — and produces readable schema files with no codegen step.

Structure:
- `schema.ts` — Drizzle table definitions (tenants, oauth_tokens, installations)
- `migrations/` — SQL migration files managed by `drizzle-kit`
- `db.ts` — driver setup (selects `postgres-js`, `mysql2`, or `better-sqlite3` based on the chosen DB)

Key packages: `drizzle-orm`, `drizzle-kit`, and the appropriate driver for the selected database.

### Pipedrive API client (`backend/pipedrive-client/`)
Wrapper around the official Pipedrive Node.js client with preconfigured authentication and helpers for common API calls.

### App Extensions frontend (`frontend/app-extension-ui/`)
Only generated when the user opts in. Iframe-based UI using the App Extensions SDK, supporting: initialization, resizing, modals, notifications/snackbars, theme handling.

## Development

To test app generation locally:

```bash
npx tsx src/cli.ts app
```

This creates an `app/` directory in the repo root (gitignored via `*-app/`).

## AI Plugin Commands (future layer)

```
/pipedrive-new-app
/pipedrive-add-oauth
/pipedrive-add-app-extension
/pipedrive-review-marketplace-readiness
```
15 changes: 15 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';

export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.recommended,
{
ignores: ['dist/**'],
},
{
rules: {
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
},
},
);
Loading
Loading