bigpowers 2.2.0 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.pi/package.json +16 -0
- package/.pi/prompts/assess-impact.md +76 -0
- package/.pi/prompts/audit-code.md +156 -0
- package/.pi/prompts/build-epic.md +44 -0
- package/.pi/prompts/change-request.md +105 -0
- package/.pi/prompts/commit-message.md +135 -0
- package/.pi/prompts/compose-workflow.md +40 -0
- package/.pi/prompts/craft-skill.md +150 -0
- package/.pi/prompts/deepen-architecture.md +235 -0
- package/.pi/prompts/define-language.md +79 -0
- package/.pi/prompts/define-success.md +62 -0
- package/.pi/prompts/delegate-task.md +76 -0
- package/.pi/prompts/design-interface.md +96 -0
- package/.pi/prompts/develop-tdd.md +375 -0
- package/.pi/prompts/diagnose-root.md +23 -0
- package/.pi/prompts/dispatch-agents.md +83 -0
- package/.pi/prompts/edit-document.md +22 -0
- package/.pi/prompts/elaborate-spec.md +81 -0
- package/.pi/prompts/enforce-first.md +77 -0
- package/.pi/prompts/evolve-skill.md +38 -0
- package/.pi/prompts/execute-plan.md +54 -0
- package/.pi/prompts/fix-bug.md +36 -0
- package/.pi/prompts/grill-me.md +95 -0
- package/.pi/prompts/grill-with-docs.md +37 -0
- package/.pi/prompts/guard-git.md +212 -0
- package/.pi/prompts/hook-commits.md +93 -0
- package/.pi/prompts/inspect-quality.md +105 -0
- package/.pi/prompts/investigate-bug.md +117 -0
- package/.pi/prompts/kickoff-branch.md +99 -0
- package/.pi/prompts/map-codebase.md +70 -0
- package/.pi/prompts/migrate-spec.md +482 -0
- package/.pi/prompts/model-domain.md +227 -0
- package/.pi/prompts/orchestrate-project.md +161 -0
- package/.pi/prompts/organize-workspace.md +159 -0
- package/.pi/prompts/plan-refactor.md +77 -0
- package/.pi/prompts/plan-release.md +145 -0
- package/.pi/prompts/plan-work.md +161 -0
- package/.pi/prompts/release-branch.md +158 -0
- package/.pi/prompts/request-review.md +70 -0
- package/.pi/prompts/research-first.md +62 -0
- package/.pi/prompts/reset-baseline.md +20 -0
- package/.pi/prompts/respond-review.md +70 -0
- package/.pi/prompts/run-evals.md +56 -0
- package/.pi/prompts/run-planning.md +26 -0
- package/.pi/prompts/scope-work.md +23 -0
- package/.pi/prompts/search-skills.md +21 -0
- package/.pi/prompts/seed-conventions.md +132 -0
- package/.pi/prompts/session-state.md +146 -0
- package/.pi/prompts/setup-environment.md +23 -0
- package/.pi/prompts/simulate-agents.md +25 -0
- package/.pi/prompts/slice-tasks.md +23 -0
- package/.pi/prompts/spike-prototype.md +94 -0
- package/.pi/prompts/stocktake-skills.md +40 -0
- package/.pi/prompts/survey-context.md +129 -0
- package/.pi/prompts/terse-mode.md +37 -0
- package/.pi/prompts/trace-requirement.md +68 -0
- package/.pi/prompts/using-bigpowers.md +105 -0
- package/.pi/prompts/validate-fix.md +98 -0
- package/.pi/prompts/verify-work.md +125 -0
- package/.pi/prompts/visual-dashboard.md +51 -0
- package/.pi/prompts/wire-observability.md +92 -0
- package/.pi/prompts/write-document.md +244 -0
- package/.pi/skills/assess-impact/SKILL.md +77 -0
- package/.pi/skills/audit-code/SKILL.md +157 -0
- package/.pi/skills/build-epic/SKILL.md +45 -0
- package/.pi/skills/change-request/SKILL.md +106 -0
- package/.pi/skills/commit-message/SKILL.md +136 -0
- package/.pi/skills/compose-workflow/SKILL.md +41 -0
- package/.pi/skills/craft-skill/SKILL.md +151 -0
- package/.pi/skills/deepen-architecture/SKILL.md +236 -0
- package/.pi/skills/define-language/SKILL.md +80 -0
- package/.pi/skills/define-success/SKILL.md +63 -0
- package/.pi/skills/delegate-task/SKILL.md +77 -0
- package/.pi/skills/design-interface/SKILL.md +97 -0
- package/.pi/skills/develop-tdd/SKILL.md +376 -0
- package/.pi/skills/diagnose-root/SKILL.md +24 -0
- package/.pi/skills/dispatch-agents/SKILL.md +84 -0
- package/.pi/skills/edit-document/SKILL.md +23 -0
- package/.pi/skills/elaborate-spec/SKILL.md +82 -0
- package/.pi/skills/enforce-first/SKILL.md +78 -0
- package/.pi/skills/evolve-skill/SKILL.md +39 -0
- package/.pi/skills/execute-plan/SKILL.md +55 -0
- package/.pi/skills/fix-bug/SKILL.md +37 -0
- package/.pi/skills/grill-me/SKILL.md +96 -0
- package/.pi/skills/grill-with-docs/SKILL.md +38 -0
- package/.pi/skills/guard-git/SKILL.md +213 -0
- package/.pi/skills/hook-commits/SKILL.md +94 -0
- package/.pi/skills/inspect-quality/SKILL.md +106 -0
- package/.pi/skills/investigate-bug/SKILL.md +118 -0
- package/.pi/skills/kickoff-branch/SKILL.md +100 -0
- package/.pi/skills/map-codebase/SKILL.md +71 -0
- package/.pi/skills/migrate-spec/SKILL.md +483 -0
- package/.pi/skills/model-domain/SKILL.md +228 -0
- package/.pi/skills/orchestrate-project/SKILL.md +162 -0
- package/.pi/skills/organize-workspace/SKILL.md +160 -0
- package/.pi/skills/plan-refactor/SKILL.md +78 -0
- package/.pi/skills/plan-release/SKILL.md +146 -0
- package/.pi/skills/plan-work/SKILL.md +162 -0
- package/.pi/skills/release-branch/SKILL.md +159 -0
- package/.pi/skills/request-review/SKILL.md +71 -0
- package/.pi/skills/research-first/SKILL.md +63 -0
- package/.pi/skills/reset-baseline/SKILL.md +21 -0
- package/.pi/skills/respond-review/SKILL.md +71 -0
- package/.pi/skills/run-evals/SKILL.md +57 -0
- package/.pi/skills/run-planning/SKILL.md +27 -0
- package/.pi/skills/scope-work/SKILL.md +24 -0
- package/.pi/skills/search-skills/SKILL.md +22 -0
- package/.pi/skills/seed-conventions/SKILL.md +133 -0
- package/.pi/skills/session-state/SKILL.md +147 -0
- package/.pi/skills/setup-environment/SKILL.md +24 -0
- package/.pi/skills/simulate-agents/SKILL.md +26 -0
- package/.pi/skills/slice-tasks/SKILL.md +24 -0
- package/.pi/skills/spike-prototype/SKILL.md +95 -0
- package/.pi/skills/stocktake-skills/SKILL.md +41 -0
- package/.pi/skills/survey-context/SKILL.md +130 -0
- package/.pi/skills/terse-mode/SKILL.md +38 -0
- package/.pi/skills/trace-requirement/SKILL.md +69 -0
- package/.pi/skills/using-bigpowers/SKILL.md +106 -0
- package/.pi/skills/validate-fix/SKILL.md +99 -0
- package/.pi/skills/verify-work/SKILL.md +126 -0
- package/.pi/skills/visual-dashboard/SKILL.md +52 -0
- package/.pi/skills/wire-observability/SKILL.md +93 -0
- package/.pi/skills/write-document/SKILL.md +245 -0
- package/CHANGELOG.md +14 -0
- package/README.md +27 -1
- package/deepen-architecture/SKILL.md +2 -0
- package/define-language/SKILL.md +2 -0
- package/diagnose-root/SKILL.md +2 -0
- package/edit-document/SKILL.md +2 -0
- package/fix-bug/SKILL.md +3 -1
- package/grill-me/SKILL.md +3 -1
- package/grill-with-docs/SKILL.md +3 -1
- package/investigate-bug/SKILL.md +5 -11
- package/map-codebase/SKILL.md +3 -1
- package/model-domain/SKILL.md +2 -0
- package/package.json +11 -2
- package/plan-release/SKILL.md +1 -1
- package/plan-work/SKILL.md +3 -1
- package/release-branch/SKILL.md +4 -2
- package/run-planning/SKILL.md +3 -2
- package/scope-work/SKILL.md +3 -1
- package/scripts/sync-skills.sh +48 -3
- package/scripts/validate-doctrine.sh +24 -9
- package/seed-conventions/SKILL.md +2 -0
- package/slice-tasks/SKILL.md +3 -1
- package/survey-context/SKILL.md +3 -1
- package/write-document/SKILL.md +2 -0
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Add structured JSON logging, observability commands, and idempotent setup scripts to a project. Use when a project needs production-readiness instrumentation, when user wants structured logging, or as a production-readiness gate at any phase of development.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
# Wire Observability
|
|
7
|
+
> **HARD GATE** — **HARD GATE** — Observability is not optional. Before shipping, verify: structured logging is in place, key metrics are instrumented, error cases emit signals. 'We'll add metrics later' becomes 'never.'
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
Add structured logging, observability commands, and idempotent setup scripts. Can be invoked at any phase — recommended at the end of the first working slice, before the first deploy.
|
|
11
|
+
|
|
12
|
+
## What this sets up
|
|
13
|
+
|
|
14
|
+
1. **Structured JSON logging** — machine-readable logs for debugging and observability
|
|
15
|
+
2. **Observability commands** — how to check the system's health documented in CLAUDE.md
|
|
16
|
+
3. **Idempotent setup scripts** — scripts that can be run repeatedly without side effects
|
|
17
|
+
|
|
18
|
+
## Process
|
|
19
|
+
|
|
20
|
+
### 1. Assess current state
|
|
21
|
+
|
|
22
|
+
Check what's already in place:
|
|
23
|
+
- Is there a logging library? (pino, winston, structlog, zap, slog, etc.)
|
|
24
|
+
- Is logging JSON or plain text?
|
|
25
|
+
- Is there a health check endpoint or command?
|
|
26
|
+
- Are there setup scripts? Are they idempotent?
|
|
27
|
+
|
|
28
|
+
### 2. Add structured JSON logging
|
|
29
|
+
|
|
30
|
+
**For user-facing CLI output:** plain text is fine.
|
|
31
|
+
**For everything else:** structured JSON.
|
|
32
|
+
|
|
33
|
+
Structured log entry format:
|
|
34
|
+
```json
|
|
35
|
+
{
|
|
36
|
+
"level": "info",
|
|
37
|
+
"timestamp": "2025-01-15T10:23:45.123Z",
|
|
38
|
+
"message": "User created",
|
|
39
|
+
"userId": "usr_abc123",
|
|
40
|
+
"requestId": "req_xyz789"
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Guidelines:
|
|
45
|
+
- Include `level`, `timestamp`, `message` in every entry
|
|
46
|
+
- Add context fields relevant to the operation (userId, requestId, traceId)
|
|
47
|
+
- Log at boundaries: HTTP requests in/out, DB queries, external API calls, background job start/end
|
|
48
|
+
- Log errors with stack traces: `logger.error({ err, context }, "Operation failed")`
|
|
49
|
+
- **Never log secrets, passwords, tokens, or PII**
|
|
50
|
+
|
|
51
|
+
### 3. Document observability commands in CLAUDE.md
|
|
52
|
+
|
|
53
|
+
Add an "Observability" section to the project's CLAUDE.md:
|
|
54
|
+
|
|
55
|
+
```markdown
|
|
56
|
+
## Observability
|
|
57
|
+
|
|
58
|
+
| What | Command |
|
|
59
|
+
|------|---------|
|
|
60
|
+
| View logs | `<log tail command>` |
|
|
61
|
+
| Health check | `<health check command>` |
|
|
62
|
+
| Check DB connection | `<db ping command>` |
|
|
63
|
+
| View metrics | `<metrics command>` |
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### 4. Write idempotent setup scripts
|
|
67
|
+
|
|
68
|
+
An idempotent script can be run multiple times and always produces the same result (no errors on re-run).
|
|
69
|
+
|
|
70
|
+
Pattern: check if the thing already exists before creating it.
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
#!/usr/bin/env bash
|
|
74
|
+
set -euo pipefail
|
|
75
|
+
|
|
76
|
+
# Idempotent: only create if not exists
|
|
77
|
+
if ! psql -c "SELECT 1 FROM pg_database WHERE datname = 'myapp'" | grep -q 1; then
|
|
78
|
+
createdb myapp
|
|
79
|
+
echo "Database created"
|
|
80
|
+
else
|
|
81
|
+
echo "Database already exists, skipping"
|
|
82
|
+
fi
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Place setup scripts in `scripts/setup.sh` (or language-appropriate equivalent). Document the command in CLAUDE.md under Commands.
|
|
86
|
+
|
|
87
|
+
### 5. Verify
|
|
88
|
+
|
|
89
|
+
- [ ] Run the app and confirm JSON logs appear in the correct format
|
|
90
|
+
- [ ] Run `scripts/setup.sh` twice — second run should produce no errors
|
|
91
|
+
- [ ] Health check command returns success
|
|
92
|
+
- [ ] No sensitive data in log output
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Write, organize, and sync high-integrity technical documents using the BMAD methodology. Ensures every document is Bold, Minimal, Actionable, and Durable. Use when creating architectural docs, technical guides, or organizing the specs/ directory.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
# Write Document (BMAD)
|
|
7
|
+
|
|
8
|
+
Create high-signal technical documentation that serves as an expert collaborator for both humans and AI. This skill enforces the BMAD principles to prevent context rot and ensure architectural durability.
|
|
9
|
+
|
|
10
|
+
**Distinct from `edit-document`:** Use this skill to create a document that does not yet exist. Use `edit-document` when a document already exists and needs restructuring, clarity, or prose improvements.
|
|
11
|
+
|
|
12
|
+
> **HARD GATE** — Every document must have a clear "Reason for Existence." If a document doesn't provide actionable leverage for a caller or test, do not create it.
|
|
13
|
+
|
|
14
|
+
## The BMAD Principles
|
|
15
|
+
|
|
16
|
+
| Principle | Execution |
|
|
17
|
+
| :--- | :--- |
|
|
18
|
+
| **B**old | Make strong assertions. Define clear boundaries and "Never" rules. No "it might" or "usually." |
|
|
19
|
+
| **M**inimal | High-density, low-filler. **Circuit Breaker**: If the file exceeds 300 lines or the session exceeds 20 turns, you MUST run `terse-mode` and compact state before saving. |
|
|
20
|
+
| **A**ctionable | Link every doc to a verifiable outcome. **Architectural Docs**: Verify via Gherkin features (`specs/verifications/features/`) or grep-based structure checks (`grep -c "pattern" file`) that prove the design's *constraints* are present. |
|
|
21
|
+
| **D**urable | Design for the long-term. **Scalability**: Use "Nested Indexing"—root files link to module-level `GEMINI.md` indexes; do not list individual sub-files in the root. |
|
|
22
|
+
|
|
23
|
+
## Process
|
|
24
|
+
|
|
25
|
+
### 1. Identify the Artifact Type & Scope
|
|
26
|
+
|
|
27
|
+
Choose the correct BMAD-BigPowers artifact:
|
|
28
|
+
- **Decision Record (ADR)**: For "Why" decisions (saved to `specs/adr/`).
|
|
29
|
+
- **Context Map**: For system-wide architectural mapping (`specs/tech-architecture/tech-stack.md`).
|
|
30
|
+
- **Technical Guide**: For "How-to" with verification (saved to `<module>/REFERENCE.md`).
|
|
31
|
+
- **Behavioral Feature**: Gherkin-style compliance specs (saved to `specs/verifications/features/`).
|
|
32
|
+
- **Project README**: Project-facing documentation (saved to `README.md` at project root).
|
|
33
|
+
|
|
34
|
+
**Cross-Cutting Concerns**: If a doc affects multiple modules, place the authoritative source in the lowest common ancestor directory and use "Delegates" (one-line pointers) in sub-directories to maintain the Single Source of Truth without violating the Stepdown Rule.
|
|
35
|
+
|
|
36
|
+
### 2. Draft with Semantic Velocity
|
|
37
|
+
|
|
38
|
+
> **STREAM CONTINUITY** — When writing file content, output in continuous chunks of ~200 lines. Do not pause. Continue immediately until complete. If you need time, emit a placeholder comment rather than going silent.
|
|
39
|
+
|
|
40
|
+
Write the document focusing on "Expert Collaboration":
|
|
41
|
+
- **Instructions over Descriptions**: Tell the reader (human or AI) exactly how to interact with the system.
|
|
42
|
+
- **Provenance Links**: Link to ADRs, Issues, or Commits to preserve intent.
|
|
43
|
+
- **The Stepdown Rule**: Information should descend exactly one level of abstraction. If a root doc needs to explain a leaf-level detail, it must point to a sub-index first.
|
|
44
|
+
|
|
45
|
+
### Quick README (Project READMEs only)
|
|
46
|
+
|
|
47
|
+
1. Ask: "Project name? One-sentence description?"
|
|
48
|
+
2. Generate `README.md` at project root using the template in [REFERENCE.md](REFERENCE.md) — no TOC, no second interview round.
|
|
49
|
+
3. Fill gaps from `CLAUDE.md` commands if available; use `TODO` markers otherwise.
|
|
50
|
+
4. Output and suggest `edit-document` for polish.
|
|
51
|
+
|
|
52
|
+
→ verify: `grep -c "^## " README.md | awk '{if($1>=7) print "OK"}'`
|
|
53
|
+
|
|
54
|
+
### 3. Apply the 94% Quality Gate
|
|
55
|
+
|
|
56
|
+
Before finalizing, audit the document against these red flags:
|
|
57
|
+
- [ ] **Filler Language**: Are there pleasantries or "I hope this helps"? (Delete them).
|
|
58
|
+
- [ ] **Ambiguity**: Are there "usually," "often," or "it depends" without specific conditions?
|
|
59
|
+
- [ ] **Dead Ends**: Does the document end without a "Next Step" or "Verification" command?
|
|
60
|
+
- [ ] **Shallow Content**: Does it restate the code without explaining the *intent* or *contracts*?
|
|
61
|
+
|
|
62
|
+
### 4. Sync and Organize
|
|
63
|
+
|
|
64
|
+
- **Big Powers Hierarchy**: Place the document in the correct tier (Global -> Project -> Sub-directory). Project READMEs are an exception — they go to project root (`README.md`), not `specs/`.
|
|
65
|
+
- **Nested Indexing**: If adding a module-level doc, ensure the module's `GEMINI.md` is updated. If the module's index is new, add it to the root `GEMINI.md`.
|
|
66
|
+
- **Sync**: Run `scripts/sync-skills.sh` if the document is a `SKILL.md` or affects generated artifacts.
|
|
67
|
+
|
|
68
|
+
## Rules
|
|
69
|
+
|
|
70
|
+
- **Minimalism is a requirement**: If a document can be a 5-line table, do not make it a 5-line essay.
|
|
71
|
+
- **Verifiable outcomes**: Every technical document must include at least one `verify:` command. For architecture, this can be a `grep` or `run_shell_command` that validates the existence of required files or patterns.
|
|
72
|
+
- **No speculative docs**: Do not write documentation for features that do not exist yet unless explicitly doing `elaborate-spec`.
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
Suggest next skill: `audit-code` or `sync-skills.sh`.
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
# Project README Template
|
|
80
|
+
|
|
81
|
+
Combined from dbader/readme-template and jehna/readme-best-practices. No TOC.
|
|
82
|
+
|
|
83
|
+
## Sections
|
|
84
|
+
|
|
85
|
+
### 1. Title + Badges
|
|
86
|
+
|
|
87
|
+
```markdown
|
|
88
|
+
# Project Name
|
|
89
|
+
|
|
90
|
+

|
|
91
|
+

|
|
92
|
+
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Fill badges from CLAUDE.md stack info if available. Default to license + version badges.
|
|
96
|
+
|
|
97
|
+
### 2. Tagline
|
|
98
|
+
|
|
99
|
+
```markdown
|
|
100
|
+
> One-line description of what this project does and why it matters.
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### 3. Description
|
|
104
|
+
|
|
105
|
+
2-3 paragraphs: what problem it solves, who it's for, and what makes it different.
|
|
106
|
+
|
|
107
|
+
### 4. Prerequisites
|
|
108
|
+
|
|
109
|
+
```markdown
|
|
110
|
+
## Prerequisites
|
|
111
|
+
|
|
112
|
+
- **Runtime**: Node.js v18+ (from CLAUDE.md)
|
|
113
|
+
- **Package manager**: npm (or pnpm/yarn)
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Auto-fill from CLAUDE.md commands section when possible.
|
|
117
|
+
|
|
118
|
+
### 5. Installation
|
|
119
|
+
|
|
120
|
+
```markdown
|
|
121
|
+
## Installation
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
npm install -g your-package
|
|
125
|
+
# or
|
|
126
|
+
npx your-package
|
|
127
|
+
```
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
Prefer npx one-shot if applicable; list global install as alternative.
|
|
131
|
+
|
|
132
|
+
### 6. Usage
|
|
133
|
+
|
|
134
|
+
```markdown
|
|
135
|
+
## Usage
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
your-command --help
|
|
139
|
+
your-command do-something
|
|
140
|
+
```
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Include the most common 1-2 commands. Link to full docs if they exist.
|
|
144
|
+
|
|
145
|
+
### 7. Features
|
|
146
|
+
|
|
147
|
+
```markdown
|
|
148
|
+
## Features
|
|
149
|
+
|
|
150
|
+
- Feature 1: short description
|
|
151
|
+
- Feature 2: short description
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
3-6 bullet points of what the project does. Derived from the project's purpose.
|
|
155
|
+
|
|
156
|
+
### 8. Configuration
|
|
157
|
+
|
|
158
|
+
```markdown
|
|
159
|
+
## Configuration
|
|
160
|
+
|
|
161
|
+
| Variable | Default | Description |
|
|
162
|
+
|----------|---------|-------------|
|
|
163
|
+
| `VAR_NAME` | `value` | What it controls |
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
Use `TODO` markers if unknown.
|
|
167
|
+
|
|
168
|
+
### 9. Development Setup
|
|
169
|
+
|
|
170
|
+
```markdown
|
|
171
|
+
## Development
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
git clone <repo-url>
|
|
175
|
+
cd project
|
|
176
|
+
npm install
|
|
177
|
+
```
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
Auto-fill from CLAUDE.md `Run` and `Build` commands.
|
|
181
|
+
|
|
182
|
+
### 10. Running Tests
|
|
183
|
+
|
|
184
|
+
```markdown
|
|
185
|
+
## Tests
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
npm test
|
|
189
|
+
npm run lint
|
|
190
|
+
```
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
Auto-fill from CLAUDE.md `Test` and `Lint` commands.
|
|
194
|
+
|
|
195
|
+
### 11. Contributing
|
|
196
|
+
|
|
197
|
+
```markdown
|
|
198
|
+
## Contributing
|
|
199
|
+
|
|
200
|
+
1. Fork the repo.
|
|
201
|
+
2. Create a feature branch (`git checkout -b feature/my-thing`).
|
|
202
|
+
3. Commit changes (`git commit -am 'Add my thing'`).
|
|
203
|
+
4. Push (`git push origin feature/my-thing`).
|
|
204
|
+
5. Open a Pull Request.
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
### 12. Changelog
|
|
208
|
+
|
|
209
|
+
```markdown
|
|
210
|
+
## Changelog
|
|
211
|
+
|
|
212
|
+
See [CHANGELOG.md](CHANGELOG.md) or [Releases](https://github.com/user/repo/releases).
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
### 13. Links
|
|
216
|
+
|
|
217
|
+
```markdown
|
|
218
|
+
## Links
|
|
219
|
+
|
|
220
|
+
- Repository: https://github.com/user/repo
|
|
221
|
+
- Issue tracker: https://github.com/user/repo/issues
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
### 14. License
|
|
225
|
+
|
|
226
|
+
```markdown
|
|
227
|
+
## License
|
|
228
|
+
|
|
229
|
+
MIT — see [LICENSE](LICENSE) for details.
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
Detect from CLAUDE.md or project LICENSE file.
|
|
233
|
+
|
|
234
|
+
### 15. Credits (optional)
|
|
235
|
+
|
|
236
|
+
```markdown
|
|
237
|
+
## Credits
|
|
238
|
+
|
|
239
|
+
Built with [bigpowers](https://github.com/danielvm-git/bigpowers).
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
## Verify
|
|
243
|
+
|
|
244
|
+
After generation, run: `grep -c "^## " README.md` — expect ≥ 7 section headings.
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: assess-impact
|
|
3
|
+
description: "Analyze the blast radius of a proposed change before any code is written. Maps dependents, affected stories, and test coverage. Produces specs/IMPACT.md. Use before plan-work on any non-trivial change, when touching a shared module, or when the user asks "what does this break?"."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
# Assess Impact
|
|
8
|
+
|
|
9
|
+
> **HARD GATE** — Run this skill before `plan-work` whenever a change touches an existing module, symbol, or file used by more than one caller. Skip only for net-new code with no existing dependents.
|
|
10
|
+
|
|
11
|
+
Find the blast radius of the proposed change before a single line is written.
|
|
12
|
+
|
|
13
|
+
## Process
|
|
14
|
+
|
|
15
|
+
### 1. Identify the target
|
|
16
|
+
|
|
17
|
+
Name the symbol, module, or file being changed. If the user hasn't specified, ask one question: "What exactly are you changing?"
|
|
18
|
+
|
|
19
|
+
### 2. Find dependents
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
grep -rn "[symbol-name]" . --include="*.ts" | grep -v node_modules
|
|
23
|
+
git log --oneline -10 -- [file-path]
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
→ verify: `grep -rn "[target]" . | wc -l`
|
|
27
|
+
|
|
28
|
+
### 3. Map to release plan stories
|
|
29
|
+
|
|
30
|
+
Read `specs/release-plan.yaml + epic capsule directories` (if it exists). For each dependent found in Step 2, identify which story owns that module. List stories that will be affected by the change.
|
|
31
|
+
|
|
32
|
+
→ verify: `grep -c "Story" specs/release-plan.yaml + epic capsule directories 2>/dev/null || echo "no release plan"`
|
|
33
|
+
|
|
34
|
+
### 4. List test coverage
|
|
35
|
+
|
|
36
|
+
Find tests that exercise the target:
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
grep -rn "[symbol-name]" . --include="*.test.*" --include="*.spec.*"
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
→ verify: `grep -rn "[target]" . --include="*.test.*" | wc -l`
|
|
43
|
+
|
|
44
|
+
### 5. Classify risk
|
|
45
|
+
|
|
46
|
+
| Level | Condition |
|
|
47
|
+
|-------|-----------|
|
|
48
|
+
| Low | ≤ 2 callers, all covered by tests |
|
|
49
|
+
| Medium | 3–10 callers, partial test coverage |
|
|
50
|
+
| High | > 10 callers, or shared API/interface, or no tests |
|
|
51
|
+
|
|
52
|
+
### 6. Write specs/IMPACT.md
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
## Target
|
|
56
|
+
[symbol or file being changed]
|
|
57
|
+
|
|
58
|
+
## Dependents ([count])
|
|
59
|
+
- [file]: [caller or usage]
|
|
60
|
+
|
|
61
|
+
## Affected Stories
|
|
62
|
+
- Story [X.Y]: [title]
|
|
63
|
+
|
|
64
|
+
## Test Coverage
|
|
65
|
+
- [test file]: covers [scenario]
|
|
66
|
+
- Gap: [untested behavior]
|
|
67
|
+
|
|
68
|
+
## Risk: Low / Medium / High
|
|
69
|
+
[One-sentence rationale]
|
|
70
|
+
|
|
71
|
+
## Recommended action
|
|
72
|
+
[Proceed / Add tests first / Discuss design]
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
→ verify: `grep "Risk:" specs/IMPACT.md`
|
|
76
|
+
|
|
77
|
+
Suggest `plan-work` once risk is understood and any test gaps are noted.
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: audit-code
|
|
3
|
+
description: "Self-review checklist for the coding agent to run before dispatching a reviewer. Checks CONVENTIONS.md compliance, Boy Scout Rule, test coverage, types, and SOLID. Produces a pass/fail checklist. Use before request-review, before committing, or when user asks for a code quality check."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
# Audit Code
|
|
8
|
+
> **HARD GATE** — **HARD GATE** — Audit must check for: bugs (correctness), security, performance, and clarity. Do NOT skip security review if the code touches user data, auth, or external APIs.
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
Run this self-review before asking anyone else to look at the code. The goal is to catch everything that is clearly wrong or missing — so the reviewer can focus on design and architecture, not hygiene.
|
|
12
|
+
|
|
13
|
+
**Distinct from `request-review`:** This is the coding agent checking its own work. No second agent is involved. Run this first; run `request-review` after this passes.
|
|
14
|
+
|
|
15
|
+
## Modes
|
|
16
|
+
|
|
17
|
+
- Default: full checklist
|
|
18
|
+
- --quick: Run only Supply Chain and Test Coverage. Use for changes under 50 LOC.
|
|
19
|
+
|
|
20
|
+
## Checklist
|
|
21
|
+
|
|
22
|
+
### Supply Chain & Security
|
|
23
|
+
|
|
24
|
+
- [ ] slopcheck run for new dependencies; packages tagged in plan-work: `[OK]`, `[SUS]`, or `[SLOP]`
|
|
25
|
+
- [ ] No `[SLOP]` packages without documented human approval
|
|
26
|
+
- [ ] No secrets in diff (`sk-`, `ghp_`, `AKIA`, `.env` values) — see `guard-git` patterns
|
|
27
|
+
- [ ] OWASP Top 10 spot-check: injection, broken auth, sensitive data exposure, misconfiguration (see `docs/references/security-threats.md`)
|
|
28
|
+
|
|
29
|
+
### Provenance & Metadata
|
|
30
|
+
|
|
31
|
+
- [ ] New plan artefacts include `type:` and `context:` metadata
|
|
32
|
+
- [ ] Implementation steps reference ADR or commit SHA where decisions were made
|
|
33
|
+
|
|
34
|
+
### Law of Demeter
|
|
35
|
+
|
|
36
|
+
- [ ] No method chains through unrelated objects (e.g. `a.getB().getC().doX()`)
|
|
37
|
+
- [ ] Collaborators talk to immediate neighbors only; law violations need explicit justification
|
|
38
|
+
|
|
39
|
+
### CONVENTIONS.md Compliance
|
|
40
|
+
|
|
41
|
+
- [ ] All output files are in `specs/` (no docs written to project root)
|
|
42
|
+
- [ ] No `gh issue create` calls anywhere in new/modified skills or scripts
|
|
43
|
+
- [ ] `gh` used only for PRs and repo clone operations
|
|
44
|
+
- [ ] No GitHub REST API called directly (no curl/fetch to api.github.com)
|
|
45
|
+
|
|
46
|
+
### Scope
|
|
47
|
+
|
|
48
|
+
- [ ] Changes are limited to what was asked — nothing extra refactored or reorganized
|
|
49
|
+
- [ ] No speculative features added
|
|
50
|
+
- [ ] No files touched outside the stated scope
|
|
51
|
+
- [ ] Changes are surgical: only code strictly required for the task; no refactoring, reorganization, or cleanup outside task scope (Boy Scout Rule applied surgically, not broadly)
|
|
52
|
+
|
|
53
|
+
### Boy Scout Rule
|
|
54
|
+
|
|
55
|
+
- [ ] Every file I touched is cleaner than when I found it
|
|
56
|
+
- [ ] No dead code left behind
|
|
57
|
+
- [ ] No commented-out code blocks
|
|
58
|
+
|
|
59
|
+
### Types and Safety
|
|
60
|
+
|
|
61
|
+
- [ ] No `any` types introduced (TypeScript) or untyped public functions (Python/Go/etc.)
|
|
62
|
+
- [ ] No `@ts-ignore` or `// eslint-disable` added
|
|
63
|
+
- [ ] No `as unknown as X` casts that bypass type safety
|
|
64
|
+
|
|
65
|
+
### Test Coverage
|
|
66
|
+
|
|
67
|
+
- [ ] Every new function has at least one test
|
|
68
|
+
- [ ] Every bug fix has a regression test
|
|
69
|
+
- [ ] Tests verify behavior through public interfaces (not implementation details)
|
|
70
|
+
- [ ] Tests are F.I.R.S.T compliant (use `enforce-first` if unsure)
|
|
71
|
+
|
|
72
|
+
### SOLID and Heuristics
|
|
73
|
+
|
|
74
|
+
- [ ] Single Responsibility: no function or module doing two unrelated things
|
|
75
|
+
- [ ] Open/Closed: extended through interfaces, not by modifying stable code
|
|
76
|
+
- [ ] Dependency Inversion: dependencies injected, not imported globally where avoidable
|
|
77
|
+
- [ ] **Chapter 17 Heuristics**: Code is free of smells documented in `audit-code/HEURISTICS.md` (G, N, C, T)
|
|
78
|
+
|
|
79
|
+
### Code Style (CONVENTIONS.md)
|
|
80
|
+
|
|
81
|
+
- [ ] Functions: 4–20 lines; split if longer
|
|
82
|
+
- [ ] Functions: descend exactly one level of abstraction (The Stepdown Rule / G34)
|
|
83
|
+
- [ ] Files: under 300 lines (ideally 200–300)
|
|
84
|
+
- [ ] Names: specific and unique (grep returns < 5 hits for each name)
|
|
85
|
+
- [ ] No duplication — shared logic extracted (DRY / G5)
|
|
86
|
+
- [ ] Early returns over nested ifs; max 2 levels of indentation
|
|
87
|
+
- [ ] Conditionals: expressed as positives (G29)
|
|
88
|
+
- [ ] Comments explain WHY, not WHAT
|
|
89
|
+
|
|
90
|
+
### Agent Readability (Akita's Lens)
|
|
91
|
+
|
|
92
|
+
- [ ] Functions are small enough to fit in a standard context window (4–20 lines)
|
|
93
|
+
- [ ] Names are unique and specific enough to be `grep`-able (grep returns < 5 hits)
|
|
94
|
+
- [ ] Types are explicit (no `any`, no inferred return types for public APIs)
|
|
95
|
+
- [ ] Code avoids deep nesting (max 2 levels) and uses early returns
|
|
96
|
+
|
|
97
|
+
### Red Flags
|
|
98
|
+
|
|
99
|
+
Before reporting, name any rationalization you caught yourself making for skipping a checklist item. Silence is not acceptable — if you skipped an item, state the reason explicitly.
|
|
100
|
+
|
|
101
|
+
## Output
|
|
102
|
+
|
|
103
|
+
Report the checklist with ✓ / ✗ per item. For each ✗, describe what needs to be fixed.
|
|
104
|
+
|
|
105
|
+
If all items pass: suggest running `request-review` for an independent second opinion.
|
|
106
|
+
If any items fail: fix them before proceeding.
|
|
107
|
+
|
|
108
|
+
## Handoff
|
|
109
|
+
|
|
110
|
+
Gate: READY -> next: commit-message
|
|
111
|
+
Writes: state.yaml handoff.next_skill = commit-message
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
# Clean Code Heuristics (Chapter 17)
|
|
116
|
+
|
|
117
|
+
A summary of Robert C. Martin's catalogue of code smells and heuristics, used as the technical benchmark for `audit-code`.
|
|
118
|
+
|
|
119
|
+
## Comments (C)
|
|
120
|
+
- **C1: Inappropriate Information**: Comments should only hold technical notes. Metadata (author, change history) belongs in Git.
|
|
121
|
+
- **C2: Obsolete Comment**: Update or delete comments that are no longer accurate.
|
|
122
|
+
- **C3: Redundant Comment**: Don't describe code that adequately describes itself (e.g., `i++; // increment i`).
|
|
123
|
+
- **C4: Poorly Written Comment**: If you write a comment, spend time making it the best it can be.
|
|
124
|
+
- **C5: Commented-Out Code**: Delete it. Git remembers it.
|
|
125
|
+
|
|
126
|
+
## Environment (E)
|
|
127
|
+
- **E1: Build Requires More Than One Step**: Building should be a single trivial operation (e.g., `bash install.sh`).
|
|
128
|
+
- **E2: Tests Require More Than One Step**: Running all tests should be one simple command (e.g., `npm test`).
|
|
129
|
+
|
|
130
|
+
## Functions (F)
|
|
131
|
+
- **F1: Too Many Arguments**: 0 is ideal, 1-2 is fine, 3 requires special justification. Never > 3.
|
|
132
|
+
- **F2: Output Arguments**: Avoid them. If a function changes state, it should change the state of its owning object.
|
|
133
|
+
- **F3: Flag Arguments**: Boolean arguments are a smell that the function does > 1 thing.
|
|
134
|
+
- **F4: Dead Function**: Discard methods that are never called.
|
|
135
|
+
|
|
136
|
+
## General (G)
|
|
137
|
+
- **G1: Multiple Languages in One Source File**: Try to minimize the mixing of languages (e.g., HTML inside Java).
|
|
138
|
+
- **G5: Duplication (DRY)**: **The root of all evil.** Every time you see duplication, it's a missed opportunity for abstraction.
|
|
139
|
+
- **G6: Code at Wrong Level of Abstraction**: High-level concepts in base classes; low-level details in derivatives.
|
|
140
|
+
- **G25: Replace Magic Numbers with Named Constants**: No "naked" numbers or strings.
|
|
141
|
+
- **G28: Encapsulate Conditionals**: Prefer `if (shouldBePublished())` over complex boolean logic.
|
|
142
|
+
- **G29: Avoid Negative Conditionals**: Prefer `if (buffer.shouldCompact())` over `if (!buffer.shouldNotCompact())`.
|
|
143
|
+
- **G30: Functions Should Do One Thing**: If a function can be split into sections, it's doing too much.
|
|
144
|
+
- **G31: Hidden Temporal Couplings**: If execution order matters, make the dependency explicit via arguments.
|
|
145
|
+
- **G34: Functions Should Descend Only One Level of Abstraction**: The Stepdown Rule.
|
|
146
|
+
|
|
147
|
+
## Naming (N)
|
|
148
|
+
- **N1: Choose Descriptive Names**: Names should reveal intent and be updated as code evolves.
|
|
149
|
+
- **N4: Unambiguous Names**: Names should make the working of a function/variable clear.
|
|
150
|
+
- **N7: Names Should Describe Side-Effects**: Describe everything the function is or does.
|
|
151
|
+
|
|
152
|
+
## Tests (T)
|
|
153
|
+
- **T1: Insufficient Tests**: A test suite should test everything that could possibly break.
|
|
154
|
+
- **T4: An Ignored Test Is a Question about an Ambiguity**: Document the reason for `@Ignore`.
|
|
155
|
+
- **T5: Test Boundary Conditions**: Most bugs happen at the boundaries; test them exhaustively.
|
|
156
|
+
- **T8: Test Coverage Patterns Can Be Revealing**: Analyze what code is *not* executed to find gaps.
|
|
157
|
+
- **T9: Tests Should Be Fast**: Slow tests don't get run.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: build-epic
|
|
3
|
+
description: "Eight-step epic build cycle — reads state.yaml, execution-status.yaml, and one epic capsule; updates status via bp-yaml-set or direct edit. Resume mode runs one step per invocation. Use instead of ad-hoc execute-plan for release work."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
# Build Epic
|
|
8
|
+
|
|
9
|
+
Scope: one story. Called by orchestrate-project Phase 4. Not a replacement for orchestrate-project.
|
|
10
|
+
|
|
11
|
+
Orchestrates the **build** flow for a single epic: survey → plan tasks → kickoff → TDD → verify → audit → commit → release.
|
|
12
|
+
|
|
13
|
+
> **HARD GATE** — Set `specs/state.yaml` `active_flow: build_epic` and `active_epic: eNN` before starting.
|
|
14
|
+
>
|
|
15
|
+
> **HARD GATE** — Not on `main`/`master` before step 3 (kickoff-branch).
|
|
16
|
+
|
|
17
|
+
## Eight steps (`epic_cycle` in state.yaml)
|
|
18
|
+
|
|
19
|
+
| Step | Skill / action |
|
|
20
|
+
|------|----------------|
|
|
21
|
+
| 1 | `survey-context` — confirm epic + story |
|
|
22
|
+
| 2 | `plan-work` — flesh out story `tasks[]` in `specs/epics/eNN-slug/epic.yaml` |
|
|
23
|
+
| 3 | `kickoff-branch` — feature branch + clean baseline |
|
|
24
|
+
| 4 | `develop-tdd` — red-green per task |
|
|
25
|
+
| 5 | `verify-work` — UAT + mechanical gates |
|
|
26
|
+
| 6 | `audit-code` — self-review checklist |
|
|
27
|
+
| 7 | `commit-message` — Conventional Commits draft |
|
|
28
|
+
| 8 | `release-branch` — PR or solo land |
|
|
29
|
+
|
|
30
|
+
## Process
|
|
31
|
+
|
|
32
|
+
1. Read `specs/state.yaml`, `specs/execution-status.yaml`, `specs/release-plan.yaml`, active `specs/epics/eNN-slug/epic.yaml`.
|
|
33
|
+
2. **BCP Tracking (Step 2):** After `plan-work` completes, read the `bcps:` count (Business Complexity Points story size) from the epic capsule and carry it into `state.yaml` as `epic_cycle.story_bcps = N`.
|
|
34
|
+
3. If `epic_cycle.step` missing, set to `1`.
|
|
35
|
+
4. Run **only the current step** (resume mode) unless user asked for full auto-run.
|
|
36
|
+
5. After step verify passes, increment `epic_cycle.step` in `state.yaml` (or `bash scripts/bp-yaml-set.sh` if available).
|
|
37
|
+
6. On story complete, set `execution-status.yaml` story key to `done`; run `bash scripts/sync-status-from-epics.sh`.
|
|
38
|
+
|
|
39
|
+
## Handoff
|
|
40
|
+
|
|
41
|
+
Write `handoff.next_skill` and `handoff.context` in `state.yaml` when pausing mid-epic.
|
|
42
|
+
|
|
43
|
+
## Verify
|
|
44
|
+
|
|
45
|
+
→ verify: `grep -q 'active_flow: build_epic' specs/state.yaml && test -f specs/epics/*/epic.yaml`
|