Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
34 changes: 34 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# dependencies (bun install)
node_modules

# output
out
dist
*.tgz

# code coverage
coverage
*.lcov

# logs
logs
_.log
report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json
Comment on lines +13 to +16

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Security & Privacy | 🟡 Minor | ⚡ Quick win

Fix the log and report ignore patterns.

_.log does not ignore normal log files, and the report pattern contains literal underscores instead of wildcards. This can leave generated logs or reports unignored and expose them to accidental commits.

Proposed fix
-_.log
-report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json
+*.log
+report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# logs
logs
_.log
report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json
# logs
logs
*.log
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.gitignore around lines 13 - 16, Update the log and report patterns in the
ignore configuration: replace the literal underscore log pattern with a wildcard
pattern that matches normal .log files, and replace the report pattern’s literal
underscores with wildcards so generated report JSON filenames are ignored.


# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# caches
.eslintcache
.cache
*.tsbuildinfo

# IntelliJ based IDEs
.idea

# Finder (MacOS) folder config
.DS_Store
26 changes: 0 additions & 26 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,6 @@ Project-specific scripts, technology choices, and setup instructions are documen
- `.agents/specs/` — What the agents are building (System & Product Architecture).
- `.agents/plans/` — How the agents will execute the current task (Short-term context).

## Spec-Driven Execution Protocol

All file modifications or code generation tasks MUST follow this lifecycle:

### Read Phase
1. Read `.agents/specs/product.md` to verify feature compliance.
2. Read `.agents/specs/system.md` to ensure architectural alignment.
3. Read `.agents/specs/ux.md` for UX and design system constraints.

### Spec Creation Sequence (when establishing a new feature)
1. **Bootstrap** — Initialize project context (`README.md`, `product.md`, `system.md`).
2. **Git Worktrees & Branch Management** — create an isolated feature branch or worktree before planning and spec changes.
3. **Create BRD** — Capture business requirements in `product_<domain>.md`.
4. **Create UX Specs** — Define design system, personas, and UX requirements in `ux.md`.
5. **Design DB** — Design relational schemas based on volumetric data; document in `system.md`.

### Execution (per task)
1. **Create Plan** — Break work into incremental, verifiable phases
(`.agents/plans/plan_YYMMDD_<name>.md`).
2. **Implement Plan** — Execute phases, verify gates, retry up to 5 times on
failure. On success, update `.agents/specs/spec-index.json` and
`.agents/specs/product.md` as needed.

### Core rule
If an implementation changes the system design, update the relevant spec files
first before writing production code.

## File Naming Conventions

Expand Down
70 changes: 48 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Specs, plans, design options, architecture decisions — these are not paperwork

## How It Works

A centralized `.agents/` directory and a universal `AGENTS.md` instruction file that every agent reads. Agents follow a **mode-tailored execution protocol**: depending on the selected mode (Prototype, Spec Driven, Rigid), they read relevant specs, create plans, explore options, and update artifacts before and after every code change.
A centralized `.agents/` directory and a universal `AGENTS.md` instruction file that every agent reads. Agents follow a **mode-tailored execution protocol**: depending on the selected mode (Prototype, Spec Driven, or Rigid), they read relevant specs, create plans, explore options, and update artifacts before and after every code change.

```
.agents/
Expand Down Expand Up @@ -45,23 +45,25 @@ A centralized `.agents/` directory and a universal `AGENTS.md` instruction file
## Quick Start

```bash
# 1. Run the interactive setup script with a target directory
./codewiser.sh ./my-project
# Interactively set up codewiser in a target project directory
bunx codewiser my-project

# 2. Select your AI agents and development mode (Prototype, Spec Driven, or Rigid)
# The script downloads the relevant skills, spec templates, and creates
# agent-specific configs with symlinks to the shared `.agents/skills/` directory.
# Or via npm (after publishing)
npx codewiser my-project
Comment on lines +48 to +52

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
rg -n '"name"|"bin"' package.json

Repository: yallma3/codewiser

Length of output: 197


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== package.json relevant fields =="
cat -n package.json | sed -n '1,80p'

echo
echo "== README setup commands around lines 48-52 =="
cat -n README.md | sed -n '40,60p'

echo
echo "== npm package availability/version/package names =="
npm view codewiser-cli name version bin --json 2>/tmp/npm_codewiser_err.log || { cat /tmp/npm_codewiser_err.log; echo; }
npm view codewiser name version bin --json 2>/tmp/npm_codewiser_cli_err.log || { cat /tmp/npm_codewiser_cli_err.log; echo; }

Repository: yallma3/codewiser

Length of output: 3797


Use codewiser-cli in the publishable run commands.

package.json declares the package as codewiser-cli with the codewiser binary, so bunx codewiser / npx codewiser resolve the wrong package. If the package stays named codewiser-cli, these commands should be updated too.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@README.md` around lines 48 - 52, Update the README run commands to invoke the
published package name codewiser-cli for both bunx and npx examples, while
preserving the existing codewiser binary usage and project-directory argument.


# 3. Start coding — agents read shared context from AGENTS.md (customized with your
# mode's execution protocol), load skills from `.agents/skills/`, and follow the
# tailored workflow defined by the selected mode.
# Or if linked locally
codewiser my-project
```

On Windows (PowerShell):
The CLI guides you through an interactive session:

```powershell
.\codewiser.ps1 .\my-project
```
1. **Select AI agents** — Choose which coding agents to configure (OpenCode, Claude Code, Cursor, Antigravity, Kilo Code)
2. **Configure mode** — Pick a development mode (Prototype, Spec Driven, or Rigid) — or select workflows in legacy mode
3. **Download files** — Downloads shared skills, spec templates, and manifest from GitHub
4. **Generate configs** — Creates agent-specific configuration files
5. **Create symlinks** — Symlinks shared skills into each agent's private directory

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Limit the symlink claim to agents that actually receive symlinks.

The current initialization code creates symlinks for Claude and Cursor only; OpenCode, Antigravity, and Kilo reference shared files directly. Change this wording to “Create supported symlinks” or enumerate the applicable agents.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@README.md` at line 64, Update the README initialization step describing
symlink creation to limit the claim to agents that actually receive symlinks,
using wording such as “Create supported symlinks” or explicitly naming Claude
and Cursor; do not imply OpenCode, Antigravity, or Kilo receive symlinks.


Use `← Back` options to navigate between steps. Press `Esc` at any time to exit.

## Supported Agents

Expand Down Expand Up @@ -89,19 +91,43 @@ Skills are shared across all agents. Create a file at `.agents/skills/<skill-nam

Example: the [git-worktrees skill](.agents/skills/shared/git-worktrees/SKILL.md) was added to teach agents how to isolate feature work using branches and worktrees during concurrent multi-agent development.

## Setup Scripts
## Requirements

| Platform | Script | Source |
|---|---|---|
| Linux / macOS | `codewiser.sh` | Downloads `AGENTS.md`, skills, and specs from `https://github.com/yallma3/codewiser` |
| Windows | `codewiser.ps1` | Same logic via PowerShell with `Invoke-WebRequest` |
- **Bun** (recommended) or **Node.js 18+**
- Git
Comment on lines +94 to +97

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
rg -n 'Bun\.write|writeFile|node:fs/promises' src package.json

Repository: yallma3/codewiser

Length of output: 832


🏁 Script executed:

#!/bin/bash
set -e
printf 'README relevant sections:\n'
sed -n '80,135p' README.md
printf '\npackage.json:\n'
cat package.json
printf '\nsrc/utils/download.ts:\n'
cat -n src/utils/download.ts
printf '\nAll Bun.write occurrences:\n'
rg -n 'Bun\.write' .

Repository: yallma3/codewiser

Length of output: 3995


Remove Node.js support until Bun.write() paths are Node-compatible.

README.md claims supported runtimes, but src/utils/download.ts uses Bun.write(dest, res) in the documented download path, and the only run script is bun-based. Use a Node-compatible file writer, or remove "or Node.js 18+" from Requirements and update the corresponding architecture note.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@README.md` around lines 94 - 97, Remove “or Node.js 18+” from the README
Requirements entry and update the corresponding architecture note to state Bun
is the supported runtime, since the documented download path relies on Bun.write
and the run script is Bun-based.


Both scripts use `manifest.json` to track artifact versions organized by development modes. During setup, you select which AI agents and which mode (**Prototype**, **Spec Driven**, or **Rigid**) to use. The selected mode determines which skills are downloaded and customizes `AGENTS.md` with the appropriate execution protocol.
## Development

## Requirements
```bash
# Clone and install
git clone https://github.com/yallma3/codewiser-cli.git
cd codewiser-cli
bun install
Comment on lines +101 to +105

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Correct the repository URL in the development setup.

This command points to yallma3/codewiser-cli, but the reviewed PR belongs to the yallma3/codewiser repository. New contributors following this instruction may clone the wrong or nonexistent repository.

Proposed fix
-git clone https://github.com/yallma3/codewiser-cli.git
+git clone https://github.com/yallma3/codewiser.git
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@README.md` around lines 101 - 105, Update the repository URL in the README
development setup clone command from yallma3/codewiser-cli to yallma3/codewiser,
leaving the surrounding installation instructions unchanged.


- Bash **or** PowerShell 5+
- Git
# Link globally (optional)
bun link

# Run directly
bun start my-project

# Or after linking
codewiser my-project
```

## How the CLI Works

The CLI uses [@clack/prompts](https://github.com/natemoo-re/clack) for interactive prompts and [meow](https://github.com/sindresorhus/meow) for CLI argument parsing. It downloads skills and specs from the [codewiser](https://github.com/yallma3/codewiser) repository based on a `manifest.json` that tracks artifact versions organized by development modes.

### Architecture

- `src/index.ts` — Entry point, parses CLI arguments, resolves target directory
- `src/commands/init.ts` — State machine orchestrating the 5-step setup process

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Correct the documented setup-step count.

The initialization flow includes confirmation and reaches step 6 for symlink creation, so describing it as a “5-step setup process” is inaccurate. Either document all six steps or avoid stating a fixed count.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@README.md` at line 124, Update the README description for the initialization
flow to reflect that setup reaches step 6, either by documenting all six steps
or by removing the fixed step count while preserving the existing description of
src/commands/init.ts.

- `src/utils/ui.ts` — Prompt wrappers with stdin resilience (@clack wrappers)
- `src/utils/prompts.ts` — Typed prompt functions for agent/mode/workflow selection
- `src/utils/download.ts` — HTTP download via `fetch()` + `Bun.write()`
- `src/utils/manifest.ts` — Manifest parsing, version comparison, file flattening
- `src/utils/generate-configs.ts` — Agent config file generation
- `src/utils/symlinks.ts` — Symlink creation with admin retry and copy fallback

## License

Expand Down
47 changes: 47 additions & 0 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading