Skip to content

Latest commit

Β 

History

62 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

@bepower/dev

CI License: MIT Node >= 22 npm: @bepower/dev

πŸ’„ Configurations and tools for developers (VERY opinionated)

This repo serves a dual purpose:

  1. @bepower/dev β€” CLI tool that bootstraps projects, distributes golden configs, and installs Kiro AI agents
  2. Org-wide defaults β€” GitHub community health files (CONTRIBUTING, SECURITY, issue/PR templates) inherited by all BePower repos

Prerequisites

  • Node.js >= 22
  • npm (not pnpm or yarn)
  • Access to GitHub Packages for @bepower scope

Installation

npm install -g @bepower/dev

Commands

dev bootstrap [name]

Scaffold a new project with standard configuration.

# Single projects (--template required)
dev bootstrap @bepower/my-lib -t lib              # npm library
dev bootstrap @bepower/my-service -t nestjs        # NestJS ECS microservice

# Monorepo (shell only, then use `dev add`)
dev bootstrap @bepower/my-project --monorepo

CDK projects use @bepower/bep-cdk-cli which provides an interactive wizard with account selection, pipeline setup, and version sync:

npx @bepower/bep-cdk-cli init

What it does:

  1. Copies the root template (single or monorepo shell)
  2. For single projects: overlays the package template (lib/nestjs)
  3. Applies golden configs (biome, tsconfig, vitest, lefthook, etc.)
  4. Merges devDependencies and scripts into package.json
  5. Copies base GitHub Actions workflows
  6. Runs npm install

dev add <path> --template <type>

Add a package to a monorepo.

dev add packages/shared -t lib                    # npm library package
dev add packages/backend -t nestjs                # NestJS microservice

For CDK infrastructure packages, use npx @bepower/bep-cdk-cli init inside the monorepo.

What it does:

  1. Copies the package template into the specified path
  2. Updates root package.json workspaces if needed
  3. Sets up package.json with correct name, repository, and directory

dev setup

Add golden configs to an existing project.

cd existing-project
dev setup            # Copy configs (skip existing files)
dev setup --force    # Overwrite existing configs with latest golden versions

What it does:

  1. Detects monorepo (workspaces) and selects appropriate config variants
  2. Copies config files (only if they don't already exist, unless --force)
  3. Merges devDependencies and scripts into package.json
  4. Adds base GitHub Actions workflows

Note: engines is only set if the project doesn't already have one. If your project has an older engines value (e.g., >= 18), update it manually.

dev diff

Show differences between local configs and the golden versions distributed by @bepower/dev.

dev diff             # List configs that differ or are missing

Useful for detecting config drift without modifying anything. To apply updates, run dev setup --force.

dev init-kiro

Install the BePower Kiro agents globally (into ~/.kiro/) for AI-assisted work across every project: the four agents, their prompts, workflow skills, hooks and steering docs.

dev init-kiro

At the end it offers an interactive opt-in β€” "Also initialize KiroCrew? (y/N)" β€” which, if accepted, runs dev init-crew for you. The prompt is skipped in non-interactive shells (CI), so the command never blocks a pipeline.

What it installs:

  1. ~/.kiro/agents/*.json β€” the four agent specs (also valid KiroCrew templates)
  2. ~/.kiro/prompts/*.md β€” their system prompts
  3. ~/.kiro/skills/ β€” workflow skills (incl. the upgrade-guardian skill)
  4. ~/.kiro/hooks/ β€” safety-gate, barrel-export, etc.
  5. ~/.kiro/steering/ β€” shared steering docs

dev init-crew

Register the installed agents as KiroCrew members so they appear in the dashboard's agent picker. Run it after dev init-kiro, or let the init-kiro prompt call it.

dev init-crew
  • Idempotent β€” re-running skips members that already exist.
  • Degrades gracefully β€” if the kirocrew binary is not installed, it prints a note and exits cleanly instead of failing (so IDE-only users are unaffected).

Installing from GitHub Packages. @bepower/dev is published to GitHub Packages (not npmjs.org). To install the CLI you need the @bepower scope mapped to the GitHub registry and a token with read:packages:

npm config set @bepower:registry https://npm.pkg.github.com
npm config set //npm.pkg.github.com/:_authToken='${GITHUB_PACKAGES_TOKEN}'
export GITHUB_PACKAGES_TOKEN="$(gh auth token)"   # reuses your gh login
npm install -g @bepower/dev

Using ${GITHUB_PACKAGES_TOKEN} keeps the token out of ~/.npmrc on disk β€” it is read from the environment at install time.

Golden Configs

These files are copied (not extended) to target projects:

Config Description
biome.json Biome linter + formatter (single quotes, 100 width, import sorting)
tsconfig.json Extends @tsconfig/node22
vitest.config.ts Vitest + v8 coverage (workspace variant for monorepos)
lefthook.yml Git hooks (pre-commit pipeline, commit-msg)
commitlint.config.ts Conventional commits
tsdown.config.ts Build with tsdown (workspace variant for monorepos)
.editorconfig Editor settings
.lockfile-lintrc.json Lockfile security
.npmpackagejsonlintrc.json package.json validation
.npmrc GitHub Packages registry for @bepower scope
.kiro/settings/lsp.json Kiro LSP configuration (TypeScript, Python, Go, Rust, Java)

Kiro AI Templates

Distributed via dev init-kiro, these configure the Kiro AI agent for BePower projects.

Workflow Skills

Trigger these in chat to switch the agent's cognitive mode:

Trigger Mode Use when
plan product Product Owner Starting a feature, vague requirements
plan eng Tech Lead Architecture, failure modes, test matrix
code review Paranoid Reviewer After implementation, before committing
qa QA Lead Verify changes, health score
ship prep Release Engineer Build/lint/test checklist + commit message
retro Engineering Manager Analyze what happened (git history)
new spec Spec Author Create structured spec from template

Typical flow: plan product β†’ plan eng β†’ implement β†’ code review β†’ qa β†’ ship prep

Hooks

Hook Trigger What it does
safety-gate preToolUse Blocks git commit/push, npm publish, destructive ops
barrel-export fileCreated Auto-updates barrel index.ts in monorepo packages
context-injection fileEdited Loads relevant steering doc based on file type
post-task-summary agentStop Summarizes changes + suggests commit message

Steering Docs

Doc Content
code-style.md TypeScript conventions, naming, error handling
build-tooling.md tsdown, biome, lefthook, npm
testing.md Vitest, coverage, mocking
interaction.md Agent behavior, workflow skills, no git commit
commit-conventions.md Conventional commits + gitmoji
architecture.md CDK patterns, NestJS structure, observability (CDK/ECS projects)

Global Agents

These agents are distributed by dev init-kiro for use across all BePower projects. Each is read-only by default β€” they analyze and propose, but never commit, push, publish, or open PRs (enforced by deniedCommands in the spec and the safety-gate hook):

Agent Description
bepower-setup Analyzes a project and generates optimal .kiro/ configuration (steering, agent, prompt, skills)
functional-analyst Interactive functional analysis β€” collects requirements through conversation, produces approval docs and technical briefs (Italian-first)
upgrade-guardian Assesses the safety of a dependency/framework upgrade in an isolated worktree and returns a reasoned LOW/MEDIUM/HIGH risk verdict with real breaking-change analysis, project impact and verification
rev-eng Reverse-engineers a target web app's internal API via Playwright and documents it for a TypeScript client

Using the Agents

Once installed, the agents live in ~/.kiro/agents/ and can be driven from two runtimes that share the same specs.

In kiro-cli / IDE

Pass the agent name to kiro-cli chat:

# in the repo you want it to work on
cd ~/projects/bepower/bep-cdk
kiro-cli chat --agent upgrade-guardian

Then start the conversation by telling it what to assess, e.g.:

"Assess the Dependabot branch that bumps datadog-cdk-constructs-v2 to 5.2.0 β€” is it safe to merge?"

The agent reads the project context (README.md, AGENTS.md if present, package.json, steering docs), does its analysis, and reports back. It will not mutate the repo.

In the KiroCrew dashboard

After dev init-crew the agents appear as members in the dashboard's agent picker. Open a new chat, pick upgrade-guardian (or rev-eng), and start the conversation the same way β€” the result (e.g. an upgrade safety report) is rendered inline, with each member keeping its own dedicated memory.

How to start the conversation

These agents are task-driven, not chatty β€” open with the concrete thing you want assessed:

Agent A good opening message
upgrade-guardian "Assess upgrading <package> from <x> to <y> in this repo. Is it safe to merge?"
rev-eng "Reverse-engineer the API of <url> and document the endpoints for a TypeScript client."
bepower-setup "Analyze this project and generate the .kiro/ configuration for it."
functional-analyst "Raccogliamo i requisiti per <feature>." (Italian-first)

The agent does the rest β€” reads context, analyzes, and returns a verdict or document. For upgrade-guardian the output is a safety report with a LOW/MEDIUM/HIGH verdict and a suggested (never executed) commit message; you decide whether to apply it.

Architecture

BePower/.github/
β”œβ”€β”€ .github/
β”‚   β”œβ”€β”€ ISSUE_TEMPLATE/          # Org-wide issue templates (bug, feature)
β”‚   β”œβ”€β”€ PULL_REQUEST_TEMPLATE.md # Org-wide PR template
β”‚   └── workflows/               # CI for this repo
β”œβ”€β”€ profile/
β”‚   └── README.md                # GitHub org profile
β”‚
β”œβ”€β”€ cli/                         # CLI source
β”‚   β”œβ”€β”€ commands/                # bootstrap, setup, add, init-kiro
β”‚   └── utils/                   # Shared utilities (configs, paths, templates)
β”œβ”€β”€ configs/                     # Golden config files (copied to target projects)
β”œβ”€β”€ kiro/                        # Kiro AI templates (agent, prompt, steering, skills)
β”‚   β”œβ”€β”€ steering/                # Single source of truth for steering docs
β”‚   β”œβ”€β”€ skills/                  # Workflow skills (plan, review, qa, ship, specs)
β”‚   └── hooks/                   # Agent hooks (safety gate, barrel export, etc.)
β”œβ”€β”€ workflows/                   # GitHub Actions templates (distributed by dev setup)
β”‚   β”œβ”€β”€ base/                    # CI, PR, security, dependabot
β”‚   β”œβ”€β”€ library/                 # npm publish
β”‚   └── docs/                    # Documentation site
β”œβ”€β”€ templates/                   # Scaffold templates
β”‚   β”œβ”€β”€ root/                    # Root templates (single, monorepo)
β”‚   └── package/                 # Package templates (lib, cdk, nestjs)
β”œβ”€β”€ docs/                        # Architecture Decision Records
β”‚
β”œβ”€β”€ CONTRIBUTING.md              # Org-wide contribution guidelines
β”œβ”€β”€ SECURITY.md                  # Org-wide security policy
β”œβ”€β”€ CODE_OF_CONDUCT.md           # Org-wide code of conduct
└── README.md                    # This file

How It Works

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                      @bepower/dev CLI                        β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚   bootstrap   β”‚   add    β”‚    setup     β”‚     init-kiro      β”‚
β”‚               β”‚          β”‚              β”‚                    β”‚
β”‚  root/        β”‚ package/ β”‚  configs/    β”‚  kiro/             β”‚
β”‚  + package/   β”‚ β†’ path   β”‚  + workflows β”‚  β†’ ~/.kiro/        β”‚
β”‚  + configs/   β”‚          β”‚  + pkg.json  β”‚                    β”‚
β”‚  + workflows  β”‚          β”‚              β”‚                    β”‚
β”‚  β†’ new dir    β”‚          β”‚  β†’ existing  β”‚                    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Stack

Tool Purpose Replaces
Biome Linting & formatting ESLint + Prettier
Lefthook Git hooks Husky + lint-staged
tsdown Building tsc / esbuild / rollup
release-please Releases semantic-release / auto
Vitest Testing Jest
commitlint Commit validation β€”
npm Package manager pnpm / yarn

Community Health (Org-wide)

This repo provides default community health files for the entire BePower GitHub organization:

These files are automatically inherited by all repos in the org that don't have their own.

Development

git clone https://github.com/BePower/.github.git
cd .github
npm install
npm run build
npm test
npm run lint

License

MIT

About

πŸ’„ Configurations and tools for developers (VERY opinionated)

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages