Skip to content

Bruno-Cunha-Souza/ValarMindSkills / skills/only-plan

only-plan

Verified

Read-only planning: analyze and design without changing project files. Writes one step-by-step plan at project root (default IMPLEMENTATION_PLAN.md). Composable with other skills (e.g. /code-security-review /only-plan). Triggers: /only-plan, 'only plan', 'apenas planejar', 'não altere os arquivos'.

FileKindSize
EXAMPLE.mdmarkdown3.0 KB
SKILL.mdskill md10.4 KB

EXAMPLE.md

View on GitHub
# Example — /code-security-review /only-plan

## Input

```text
/code-security-review /only-plan
```

Project: a small Express API with a login endpoint. The companion skill's analysis phases run and find two issues; its fix phases are suppressed and become plan steps.

## Output 1 — `IMPLEMENTATION_PLAN.md` (created at project root)

````markdown
# Implementation Plan — Security fixes for login API

> Generated by /only-plan on 2026-06-11. No project files were modified.
> Scope: fix the issues found by the security review of the login flow.  [Companion: @code-security-review]

## Context

@code-security-review Phase 1–2 found two findings:

- **High** — SQL injection: template literal interpolates `email` into the query (`src/routes/login.ts:18`).
- **Medium** — no rate limiting on `POST /login`, allowing credential stuffing (`src/app.ts:24`).

## Current state

- `src/routes/login.ts:18` — `db.query(`SELECT * FROM users WHERE email = '${email}'`)`
- `src/app.ts:24` — `app.use('/login', loginRouter)` mounted with no throttling middleware.

## Steps

### Step 1 — Parameterize the login query

- **File:** `src/routes/login.ts` (existing)
- **Change:** replace string interpolation with a parameterized query to eliminate the injection vector.
- **Snippet:**
  ```ts
  // before
  const user = await db.query(`SELECT * FROM users WHERE email = '${email}'`);
  // after
  const user = await db.query("SELECT * FROM users WHERE email = $1", [email]);
  ```
- **Validate:** `npm test -- login` — existing login tests pass; manual probe `' OR 1=1 --` returns 401.

### Step 2 — Add rate limiting to the login route

- **File:** `src/app.ts` (existing)
- **Change:** throttle `POST /login` with `express-rate-limit` (5 attempts / 15 min per IP).
- **Snippet:**
  ```ts
  import rateLimit from "express-rate-limit";
  const loginLimiter = rateLimit({ windowMs: 15 * 60 * 1000, max: 5 });
  app.use("/login", loginLimiter, loginRouter);
  ```
- **Validate:** 6th request within the window returns `429 Too Many Requests`.

## Execution order and dependencies

Step 1 and Step 2 are independent; either order works. Step 2 requires installing `express-rate-limit` first (`npm install express-rate-limit`).

## Validation

- `npm test` — full suite green.
- `npm audit` — no new advisories from the added dependency.

## Risks and rollback

- Step 1: behavior-preserving; revert the single query line if login regressions appear.
- Step 2: tune `max` if legitimate users hit the limit; remove the middleware line to roll back.

## Out of scope

- Password hashing uses bcrypt cost 10 — adequate; not planned.
- Session fixation review deferred to a dedicated audit.
````

## Output 2 — chat report

```text
Plan written: IMPLEMENTATION_PLAN.md (2 steps, 2 files affected)
Project files touched: none (verified via git status --porcelain)

Summary:
  Step 1 — parameterize the login query (SQL injection, High)
  Step 2 — rate-limit POST /login (credential stuffing, Medium)

Next: review the plan; apply it manually, or re-invoke the task without /only-plan to implement.
```
rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first.Stars: 194kUpdated Claude CodeCodexVerifiedInstall