@softspark/ai-toolkit 3.5.0 → 4.0.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.
Files changed (53) hide show
  1. package/AGENTS.md +18 -23
  2. package/CHANGELOG.md +60 -0
  3. package/README.md +20 -10
  4. package/app/.claude-plugin/plugin.json +1 -1
  5. package/app/ARCHITECTURE.md +1 -9
  6. package/app/agents/chief-of-staff.md +1 -1
  7. package/app/agents/meta-architect.md +1 -1
  8. package/app/agents/night-watchman.md +1 -1
  9. package/app/agents/orchestrator.md +1 -1
  10. package/app/agents/predictive-analyst.md +1 -1
  11. package/app/agents/product-manager.md +1 -1
  12. package/app/plugins/research-pack/plugin.json +1 -1
  13. package/app/skills/a11y-validate/SKILL.md +1 -1
  14. package/app/skills/api-patterns/SKILL.md +1 -1
  15. package/app/skills/app-builder/SKILL.md +1 -1
  16. package/app/skills/architecture-audit/SKILL.md +1 -1
  17. package/app/skills/biz-scan/SKILL.md +1 -1
  18. package/app/skills/ci-cd-patterns/SKILL.md +1 -1
  19. package/app/skills/debug/SKILL.md +28 -0
  20. package/app/skills/design-an-interface/SKILL.md +1 -1
  21. package/app/skills/docker-devops/SKILL.md +1 -1
  22. package/app/skills/evolve/SKILL.md +1 -1
  23. package/app/skills/explain/SKILL.md +1 -1
  24. package/app/skills/explore/SKILL.md +1 -1
  25. package/app/skills/flutter-patterns/SKILL.md +1 -1
  26. package/app/skills/git-mastery/SKILL.md +1 -1
  27. package/app/skills/index/SKILL.md +1 -1
  28. package/app/skills/mcp-patterns/SKILL.md +1 -1
  29. package/app/skills/mem-search/SKILL.md +1 -1
  30. package/app/skills/migrate/SKILL.md +1 -1
  31. package/app/skills/migration-patterns/SKILL.md +1 -1
  32. package/app/skills/observability-patterns/SKILL.md +1 -1
  33. package/app/skills/performance-profiling/SKILL.md +1 -1
  34. package/app/skills/persona/SKILL.md +1 -1
  35. package/app/skills/plan/SKILL.md +22 -0
  36. package/app/skills/refactor-plan/SKILL.md +1 -1
  37. package/app/skills/research-mastery/SKILL.md +13 -1
  38. package/app/skills/swarm/SKILL.md +10 -5
  39. package/app/skills/typescript-patterns/SKILL.md +1 -1
  40. package/kb/procedures/release-verification-sop.md +1 -1
  41. package/kb/reference/codex-cli-compatibility.md +0 -1
  42. package/kb/reference/opencode-compatibility.md +1 -1
  43. package/kb/reference/skills-catalog.md +2 -13
  44. package/llms-full.txt +22 -39
  45. package/manifest.json +3 -3
  46. package/package.json +2 -2
  47. package/scripts/codex_skill_adapter.py +2 -7
  48. package/app/skills/debugging-tactics/SKILL.md +0 -136
  49. package/app/skills/hive-mind/SKILL.md +0 -57
  50. package/app/skills/plan-writing/SKILL.md +0 -228
  51. package/app/skills/search/SKILL.md +0 -64
  52. package/app/skills/teams/SKILL.md +0 -63
  53. package/app/skills/teams/reference/presets.md +0 -52
@@ -69,6 +69,6 @@ Unlike `--persona` at install time (which injects into CLAUDE.md permanently), `
69
69
  ## When NOT to Use
70
70
 
71
71
  - For **permanent** persona injection at install time — use `ai-toolkit install --persona <name>` (project or global)
72
- - For multi-agent parallel work with different specialists — use `/orchestrate` or `/teams`
72
+ - For multi-agent parallel work with different specialists — use `/orchestrate` or `/workflow`
73
73
  - For a specific language or framework context (not a general engineering stance) — use the language-pattern skills (`/typescript-patterns`, etc.)
74
74
  - To edit or create a persona file — edit `app/personas/<name>.md` directly; this skill only switches between existing ones
@@ -46,6 +46,28 @@ smart_query("project template: {type}")
46
46
  hybrid_search_kb("architecture {pattern}")
47
47
  ```
48
48
 
49
+ ## Estimation & Templates
50
+
51
+ ### T-shirt sizing (use for >1 day work)
52
+
53
+ | Size | Effort | Example |
54
+ |------|--------|---------|
55
+ | XS | <2h | typo, add field |
56
+ | S | 2-4h | simple component, basic API |
57
+ | M | 1-2 days | feature with tests |
58
+ | L | 3-5 days | complex feature |
59
+ | XL | 1-2 weeks | major subsystem |
60
+
61
+ Avoid hour-precise estimates beyond a week — they are false confidence (cone of uncertainty: 4× variance at idea, 1.5× at design).
62
+
63
+ ### SMART tasks vs phase outcomes
64
+
65
+ Plan-level tasks should be **phase-aligned outcomes** ("authentication ships behind a feature flag"), not SMART implementation steps ("add JWT middleware"). The latter belongs in the issue tracker after `/prd-to-issues`.
66
+
67
+ ### Pre-mortem (mandatory for >1 day plans)
68
+
69
+ List ≥5 named failure modes with mitigation. A 2-bullet pre-mortem is theater. Risk register cap: 10 entries ranked by (probability × impact); below line 10 is noise.
70
+
49
71
  ## Related Skills
50
72
 
51
73
  - Plan approved? -> `/orchestrate` or `/workflow` to execute with agents
@@ -126,5 +126,5 @@ What is explicitly NOT part of this refactor.
126
126
  - For **executing** a refactor directly — use `/refactor`
127
127
  - For architecture-level audit without a specific refactor in mind — use `/architecture-audit`
128
128
  - For creating a PRD (product requirements) — use `/write-a-prd`
129
- - For a plan without the GitHub RFC step — use `/plan` or `/plan-writing`
129
+ - For a plan without the GitHub RFC step — use `/plan`
130
130
  - For interface design of a single module — use `/design-an-interface`
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: research-mastery
3
- description: "Hierarchical retrieval: KB first (smart_query/crag_search), then MCP/Context7, then web. Triggers: research, fact-check, verify, synthesize, cross-reference, multi-source, investigate, cite sources."
3
+ description: "Hierarchical retrieval: KB MCP/Context7 web. Triggers: research, fact-check, verify, synthesize, cross-reference, multi-source, cite sources."
4
4
  effort: medium
5
5
  user-invocable: false
6
6
  allowed-tools: Read
@@ -43,6 +43,18 @@ You MUST search in this order. Do not skip steps.
43
43
  **Why**: Fallback for general programming concepts.
44
44
  **Rule**: Use only for generic syntax/logic, NEVER for project specifics.
45
45
 
46
+ ## Local Fallback (No MCP Available)
47
+
48
+ If `rag-mcp` is not configured, fall back to filesystem tools — still inside `kb/`:
49
+
50
+ ```
51
+ Grep pattern="your query" path="kb/" # search file contents
52
+ Glob pattern="kb/**/*.md" # list KB files
53
+ Read "kb/reference/architecture.md" # full document
54
+ ```
55
+
56
+ Always cite sources as `[PATH: kb/...]` regardless of which method retrieved them.
57
+
46
58
  ## 🛑 Validation Protocol
47
59
  Before acting on information:
48
60
  1. **Cite the Source**: "According to `kb/architecture.md`..."
@@ -30,7 +30,7 @@ Agent(subagent_type="...", prompt="sub-task 2 — own files: path/b/")
30
30
  Agent(subagent_type="...", prompt="sub-task N — own files: path/n/")
31
31
  ```
32
32
 
33
- After all complete: aggregate results with `hive-mind` skill, produce synthesis report.
33
+ After all complete: aggregate results (see Aggregation section below), produce synthesis report.
34
34
 
35
35
  ### Consensus
36
36
  Same problem, 3 independent agents from different angles. Launch all 3 **in a single response**.
@@ -75,10 +75,15 @@ Agent(
75
75
 
76
76
  ## Aggregation (after all agents complete)
77
77
 
78
- 1. Collect all agent outputs
79
- 2. De-duplicate identical findings
80
- 3. Synthesize unique insights
81
- 4. Generate final swarm report
78
+ 1. **Collect** all agent outputs into a uniform format (JSON or Markdown sections)
79
+ 2. **De-duplicate** identical findings across agents
80
+ 3. **Synthesize** unique insights into one report
81
+ 4. **For Consensus mode**: weighted voting — each agent returns confidence 0.0–1.0, winner is highest-confidence solution; record dissents from agents that scored below winner
82
+ 5. **Generate** final swarm report
83
+
84
+ ### File ownership during aggregation
85
+
86
+ When agents touch overlapping paths despite ownership rules: do NOT auto-merge. Escalate to user citing which two agents touched the same hunk. Use `--worktree` mode to prevent this proactively (see below).
82
87
 
83
88
  ## KB-First Mode (`--with-kb`)
84
89
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: typescript-patterns
3
- description: "TypeScript type safety: generics, conditional types, discriminated unions, Zod, satisfies, branded types. Triggers: TypeScript, TS, generics, Zod, satisfies, type narrowing, strict mode."
3
+ description: "TypeScript types: generics, discriminated unions, Zod, satisfies, branded types. Triggers: TypeScript, TS, generics, Zod, satisfies, strict mode."
4
4
  effort: medium
5
5
  user-invocable: false
6
6
  allowed-tools: Read
@@ -201,7 +201,7 @@ python3 scripts/audit_skills.py --ci
201
201
  **Verify audit_skills.py:**
202
202
  - [ ] `HIGH: 0` (MUST be zero — CI fails otherwise)
203
203
  - [ ] `WARN: 0`
204
- - [ ] `INFO: N` (acceptable — broad-access skills: orchestrate, swarm, teams)
204
+ - [ ] `INFO: N` (acceptable — broad-access skills: orchestrate, swarm, workflow)
205
205
 
206
206
  ---
207
207
 
@@ -80,7 +80,6 @@ The main adapted group is multi-agent orchestration:
80
80
  - `/orchestrate`
81
81
  - `/workflow`
82
82
  - `/swarm`
83
- - `/teams`
84
83
  - `/subagent-development`
85
84
 
86
85
  The adapter also covers skills that previously depended only on Claude's
@@ -129,7 +129,7 @@ User-authored opencode files and user-authored `opencode.json` keys are never de
129
129
  ## Behavioral Limits
130
130
 
131
131
  - opencode does not expose the full Claude hook event surface; only the events in the mapping table above are bridged. Claude-only events (`TaskCompleted`, `TeammateIdle`, `SubagentStart`, `SubagentStop`, `PreCompact`) are silently skipped.
132
- - Multi-agent orchestration skills (`/orchestrate`, `/workflow`, `/swarm`, `/teams`, `/subagent-development`) run through the Codex adaptation layer — they use opencode subagents and explicit file ownership instead of Claude's `Agent`/`TaskCreate` primitives.
132
+ - Multi-agent orchestration skills (`/orchestrate`, `/workflow`, `/swarm`, `/subagent-development`) run through the Codex adaptation layer — they use opencode subagents and explicit file ownership instead of Claude's `Agent`/`TaskCreate` primitives.
133
133
 
134
134
  ## Verification
135
135
 
@@ -23,7 +23,7 @@ All functionality is unified under skills. Task and hybrid skills are user-invoc
23
23
  | **2 — Multi-agent workflow** | `/workflow <type>` | Cross-cutting task with known pattern |
24
24
  | **3 — Custom parallelism** | `/orchestrate`, `/swarm` | No predefined workflow matches |
25
25
 
26
- ## Task Skills (32)
26
+ ## Task Skills (30)
27
27
 
28
28
  Task skills execute a specific action. Invoked via slash commands. `disable-model-invocation: true`.
29
29
 
@@ -76,13 +76,11 @@ Hybrid skills combine slash-command invocation with domain knowledge that agents
76
76
  | **analyze** | `/analyze` | medium | Analyze code quality, complexity, and patterns |
77
77
  | **cve-scan** | `/cve-scan` | medium | Scan project dependencies for known CVEs using native audit tools (npm, pip, composer, cargo, go, ruby, dart) |
78
78
  | **docs** | `/docs` | high | Generate/update docs: README, API docs, architecture notes, changelogs (Tier 1 — single agent) |
79
- | **search** | `/search` | medium | Search knowledge base (MCP tools with local fallback) |
80
79
  | **explain** | `/explain` | medium | Explain architecture of a file/module using Mermaid diagrams |
81
80
  | **orchestrate** | `/orchestrate` | max | Custom multi-agent parallelism — Tier 3, native in Claude, Codex-adapted to `spawn_agent` workflows |
82
81
  | **swarm** | `/swarm` | max | Massive parallelism: map-reduce, consensus, relay — Tier 3 |
83
82
  | **workflow** | `/workflow` | max | 15 predefined multi-agent workflow types — Tier 2, Codex-adapted to native subagent orchestration |
84
83
  | **instinct-review** | `/instinct-review` | low | Review, curate, and manage learned instincts from past sessions |
85
- | **teams** | `/teams` | max | Launch pre-configured Agent Teams compositions for common workflows |
86
84
  | **write-a-prd** | `/write-a-prd` | high | Create PRD through interactive interview, codebase exploration, and module design |
87
85
  | **prd-to-plan** | `/prd-to-plan` | high | Convert PRD into phased implementation plan using tracer-bullet vertical slices |
88
86
  | **tdd** | `/tdd` | high | Test-driven development with red-green-refactor loop and vertical slices |
@@ -163,24 +161,16 @@ Hybrid skills combine slash-command invocation with domain knowledge that agents
163
161
  | **content-moderation-patterns** | `skills/content-moderation-patterns/` | Two-stage moderation: pre-filter + LLM classifier; categories; thresholds |
164
162
  | **model-routing-patterns** | `skills/model-routing-patterns/` | Haiku/Sonnet/Opus routing; escalation; sub-agent delegation; fallback |
165
163
 
166
- ## Knowledge Skills - Process (7)
164
+ ## Knowledge Skills - Process (5)
167
165
 
168
166
  | Skill | Directory | Domain |
169
167
  |-------|-----------|--------|
170
- | **plan-writing** | `skills/plan-writing/` | Implementation plans, success criteria, pre-mortem |
171
- | **debugging-tactics** | `skills/debugging-tactics/` | Iron Law 4-phase debugging: root cause → pattern → hypothesis → fix |
172
168
  | **git-mastery** | `skills/git-mastery/` | Git workflows, branching, conflict resolution |
173
169
  | **architecture-decision** | `skills/architecture-decision/` | Architecture notes, trade-off analysis, alternatives |
174
170
  | **performance-profiling** | `skills/performance-profiling/` | Profiling, bottleneck analysis, optimization |
175
171
  | **research-mastery** | `skills/research-mastery/` | Multi-source research, synthesis, fact-checking |
176
172
  | **verification-before-completion** | `skills/verification-before-completion/` | Iron Law: evidence-before-claims, no completion without fresh verification |
177
173
 
178
- ## Knowledge Skills - Orchestration (1)
179
-
180
- | Skill | Directory | Domain |
181
- |-------|-----------|--------|
182
- | **hive-mind** | `skills/hive-mind/` | Multi-agent aggregation, consensus, swarm patterns |
183
-
184
174
  ## Quality Guardrails
185
175
 
186
176
  ### Anti-Rationalization Tables
@@ -272,7 +262,6 @@ Common adapted skills:
272
262
  - `/orchestrate`
273
263
  - `/workflow`
274
264
  - `/swarm`
275
- - `/teams`
276
265
  - `/subagent-development`
277
266
  - `/tdd`
278
267
 
package/llms-full.txt CHANGED
@@ -66,20 +66,20 @@
66
66
 
67
67
  ## Skills
68
68
 
69
- - **a11y-validate**: Accessibility validator for WCAG 2.1 AA, EN 301 549, EAA. Covers ARIA, contrast, keyboard, forms, media. Triggers: a11y, accessibility, WCAG, EAA, ARIA, contrast, keyboard nav, screen reader.
69
+ - **a11y-validate**: Accessibility validator: WCAG 2.1 AA, EN 301 549, EAA. Triggers: a11y, accessibility, WCAG, EAA, ARIA, contrast, keyboard, screen reader.
70
70
  - **agent-creator**: Creates new specialized agents with frontmatter, tools, delegation. Triggers: new agent, create agent, agent scaffold, specialized agent.
71
71
  - **analyze**: Analyzes code quality, complexity, patterns across codebase. Triggers: quality report, hotspot scan, code analysis, architecture signal.
72
- - **api-patterns**: REST/GraphQL API design: naming, versioning, pagination, idempotency, OpenAPI. Triggers: API design, REST, GraphQL, endpoint, OpenAPI, Swagger, pagination, idempotency key, rate limit.
73
- - **app-builder**: App scaffolding: Next.js, Vite, Nuxt, Astro, FastAPI, Django, Laravel, RN, Flutter, Unity. Triggers: scaffold, bootstrap, new project, starter, build app, landing page, dashboard, mobile app.
74
- - **architecture-audit**: Audits codebase for architectural friction and shallow modules, proposes deepening refactors as RFCs. Triggers: improve architecture, shallow modules, deepen modules, reduce coupling.
72
+ - **api-patterns**: REST/GraphQL API design: naming, versioning, pagination, idempotency, OpenAPI. Triggers: API design, REST, GraphQL, OpenAPI, Swagger, idempotency, rate limit.
73
+ - **app-builder**: App scaffolding: Next.js, Vite, Nuxt, Astro, FastAPI, Django, Laravel, RN, Flutter. Triggers: scaffold, bootstrap, new project, starter, dashboard, mobile app.
74
+ - **architecture-audit**: Audits codebase for architectural friction, shallow modules; proposes RFCs. Triggers: improve architecture, shallow modules, deepen modules, reduce coupling.
75
75
  - **architecture-decision**: Architecture decisions in ADR/RFC/RFD format: context, constraints, options, recommendation. Triggers: ADR, RFC, RFD, trade-offs, design choice, pick between, evaluate approach.
76
- - **biz-scan**: Scans codebase (schemas, endpoints, events, flags) for revenue opportunities, missing KPIs, monetization gaps. Triggers: business metrics, KPI coverage, analytics gaps, monetization, revenue opportunity.
76
+ - **biz-scan**: Scans codebase for revenue opportunities, KPIs, monetization gaps. Triggers: business metrics, KPI, analytics gaps, monetization, revenue.
77
77
  - **brand-voice**: Direct technical voice for docs, README, user-facing text. Concise/strict modes. Triggers: documentation, README, content, output-mode, voice, prose style.
78
78
  - **briefing**: Executive daily briefing aggregating reports from all agents into decision-focused summary. Triggers: briefing, daily summary, status across system, executive update.
79
79
  - **build**: Builds project with auto-detected toolchain (npm, poetry, cargo, go, flutter, Docker). Triggers: build, compile, bundle, produce artifacts.
80
80
  - **chaos**: Injects controlled faults for resilience testing on non-prod. Triggers: chaos, fault injection, latency injection, dependency kill, resilience test.
81
81
  - **ci**: Detect/generate/debug CI pipeline config (GitHub Actions, GitLab CI). Triggers: CI setup, build pipeline, GitHub Actions config, debug CI, GitLab CI.
82
- - **ci-cd-patterns**: CI/CD: GitHub Actions, GitLab CI, Jenkins, caching, blue-green, canary, rollback gates. Triggers: CI, CD, pipeline, GitHub Actions, workflow YAML, release, artifact, canary, rollout.
82
+ - **ci-cd-patterns**: CI/CD: GitHub Actions, GitLab CI, Jenkins, caching, blue-green, canary. Triggers: CI, CD, pipeline, GitHub Actions, workflow YAML, release, canary, rollout.
83
83
  - **clean-code**: Code quality: meaningful names, SRP, DRY, small functions, guard clauses, refactoring. Triggers: clean code, naming, code smell, SRP, DRY, long function, god class, dead code.
84
84
  - **command-creator**: Creates new Claude Code slash commands with frontmatter and validation. Triggers: new slash command, create command, command scaffold.
85
85
  - **commit**: Creates Conventional Commits with pre-commit validation. Triggers: commit, conventional commit, git commit, message.
@@ -92,26 +92,24 @@
92
92
  - **dart-rules**: Dart/Flutter coding rules: style, patterns, security, testing. Triggers: .dart, pubspec.yaml, Flutter, Riverpod, Bloc, widget, StatelessWidget, StatefulWidget.
93
93
  - **database-patterns**: DB schema design and query tuning: normalization, indexing, N+1, transactions, EXPLAIN. Triggers: schema, index, slow query, N+1, PostgreSQL, MySQL, EXPLAIN, deadlock, query plan.
94
94
  - **debug**: Systematic debugging via logs, health checks, hypothesis-driven investigation. Triggers: debug, error, trace root cause, fix bug, reproduce symptom, investigation.
95
- - **debugging-tactics**: RCA debugging: investigation, hypothesis, validation, fix. No fix without RCA. Triggers: bug, error, exception, stack trace, intermittent, flaky, crash, regression, broken after.
96
95
  - **deploy**: Deploys with pre-flight checks and health verification. Triggers: deploy, deployment, ship, release, push to prod.
97
- - **design-an-interface**: Generates multiple alternative interface designs in parallel and compares them (Ousterhout 'Design It Twice'). Triggers: design API, interface options, compare modules, design it twice.
96
+ - **design-an-interface**: Generates and compares parallel interface designs (Ousterhout 'Design It Twice'). Triggers: design API, interface options, compare modules, design it twice.
98
97
  - **design-engineering**: UI craftsmanship: animation rules, easing, micro-interactions, state polish. Triggers: animation, transition, ease-out, motion, micro-interaction, hover, loading state, UI polish.
99
- - **docker-devops**: Docker/K8s/DevOps: Dockerfile, multi-stage builds, compose, manifests, Helm, image hardening. Triggers: Docker, Dockerfile, container, Kubernetes, k8s, compose, Helm, pod, deployment yaml.
98
+ - **docker-devops**: Docker/K8s: Dockerfile, multi-stage, compose, manifests, Helm. Triggers: Docker, Dockerfile, container, Kubernetes, k8s, compose, Helm, pod.
100
99
  - **docs**: Generates/updates README, API docs, architecture notes. Triggers: docs, README, API docs, architecture note, documentation.
101
100
  - **documentation-standards**: KB conventions: YAML frontmatter, 5-category taxonomy (reference/howto/procedures/troubleshooting/best-practices). Triggers: kb/, SOP, runbook, howto, frontmatter, knowledge base.
102
101
  - **ecommerce-patterns**: E-commerce: cart, checkout, payments (Stripe/Adyen), order state, inventory, promos, tax. Triggers: cart, checkout, SKU, payment, Stripe, Shopify, Medusa, Magento, coupon, refund.
103
102
  - **evaluate**: Evaluates RAG retrieval and LLM-as-judge metrics (faithfulness, relevancy, context precision). Triggers: measure RAG quality, knowledge gap, RAG eval, golden dataset.
104
- - **evolve**: Analyzes failure patterns in agents/skills and drafts targeted prompt/permission improvements. Triggers: improve agent, refine skill, update system prompt, optimize agent, fix failure pattern.
103
+ - **evolve**: Analyzes agent/skill failures, drafts prompt/permission fixes. Triggers: improve agent, refine skill, system prompt, optimize agent.
105
104
  - **explain**: Explains code/architecture with Mermaid diagrams and sequence flows. Triggers: what does X do, how does Y work, explain code, sequence diagram.
106
105
  - **explore**: Explores codebase structure, stack, and architecture. Triggers: explore codebase, project structure, stack overview, architecture map.
107
106
  - **fix**: Applies targeted fix to known bug/lint error, verifies with same command that surfaced it. Triggers: fix, apply fix, fix bug, fix lint, targeted fix.
108
- - **flutter-patterns**: Flutter/Dart: widget composition, state mgmt (Riverpod/Bloc/Provider), navigation, platform channels. Triggers: Flutter, Dart, widget, Riverpod, Bloc, pubspec, Navigator, hot reload.
109
- - **git-mastery**: Advanced Git: rebase, bisect, reflog, cherry-pick, worktrees, history rewriting, LFS. Triggers: git rebase, bisect, cherry-pick, reflog, force push, merge conflict, worktree, submodule.
107
+ - **flutter-patterns**: Flutter/Dart: widgets, state mgmt (Riverpod/Bloc), navigation, platform channels. Triggers: Flutter, Dart, widget, Riverpod, Bloc, pubspec, hot reload.
108
+ - **git-mastery**: Advanced Git: rebase, bisect, reflog, cherry-pick, worktrees, LFS. Triggers: rebase, bisect, cherry-pick, reflog, force push, merge conflict, worktree.
110
109
  - **golang-rules**: Go coding rules: style, patterns, security, testing. Triggers: .go, go.mod, go.sum, Gin, Echo, Gorilla, testing, gofmt.
111
110
  - **grill-me**: Stress-tests a plan via Socratic questioning down each decision branch. Triggers: stress-test, grill me, validate assumptions, challenge plan, socratic review.
112
111
  - **health**: Service/infra health via liveness/readiness checks, resource usage, quick diagnostics. Triggers: health check, services up, system status, infra health, degraded service.
113
112
  - **hipaa-validate**: HIPAA validator: PHI exposure, audit logging, encryption, access control, BAA refs. Triggers: HIPAA, PHI, healthcare compliance, audit log, BAA.
114
- - **hive-mind**: Multi-agent swarm: consensus voting, output aggregation, file ownership, map-reduce. Triggers: swarm, hive mind, multi-agent, consensus, parallel agents, team of agents, agent voting.
115
113
  - **hook-creator**: Create new Claude Code lifecycle hook (PreToolUse/PostToolUse/Stop/SessionStart) with bash + hooks.json. Triggers: create hook, lifecycle hook, PreToolUse, PostToolUse, hook event.
116
114
  - **index**: Reindexes KB for semantic search via vector store (Qdrant). Triggers: reindex KB, rebuild index, vector reindex, refresh embeddings.
117
115
  - **instinct-review**: Reviews/promotes/removes instincts from `.claude/instincts/*.md`. Triggers: instinct review, curate instincts, manage instincts, promote instinct.
@@ -123,22 +121,21 @@
123
121
  - **kotlin-rules**: Kotlin coding rules: style, patterns, security, testing. Triggers: .kt, .kts, build.gradle.kts, Ktor, Jetpack Compose, coroutines, kotlinx.
124
122
  - **lint**: Runs linter+typechecker with auto-detected toolchain (ruff/mypy, eslint/tsc, phpstan, golangci-lint, clippy). Triggers: lint, typecheck, static analysis.
125
123
  - **mcp-builder**: Builds production MCP servers via 4-phase methodology: research, implement, test, evaluate. Triggers: build MCP, new MCP, MCP integration, MCP server scaffold.
126
- - **mcp-patterns**: MCP server design: tool schemas, resources, stdio/SSE transports, capability negotiation. Triggers: MCP, Model Context Protocol, MCP server, JSON-RPC, stdio, SSE, Claude Desktop config.
124
+ - **mcp-patterns**: MCP server design: tool schemas, resources, stdio/SSE, capability negotiation. Triggers: MCP, Model Context Protocol, JSON-RPC, stdio, SSE, Claude Desktop.
127
125
  - **medplum-rules**: Medplum (FHIR healthcare) coding rules: style, patterns, security, testing. Triggers: medplum.config.mts, medplum.config.ts, FHIR, Medplum, Bot, Subscription, Questionnaire.
128
126
  - **mem-search**: Searches past coding sessions for observations, decisions, context. Triggers: mem-search, recall session, past work, prior decisions, session history.
129
- - **migrate**: Run/create DB migrations with detected tool (Alembic, Prisma, Laravel, Django, Flyway, Drizzle), checks backup. Triggers: apply migration, rollback, generate migration, db migration.
130
- - **migration-patterns**: Zero-downtime DB migrations: expand-contract, double-write, backfill, blue-green schema. Triggers: migration, schema change, zero-downtime, backfill, ALTER TABLE, online DDL, safe deploy.
127
+ - **migrate**: Run/create DB migrations (Alembic, Prisma, Laravel, Django, Flyway, Drizzle); checks backup. Triggers: apply migration, rollback, generate migration.
128
+ - **migration-patterns**: Zero-downtime DB migrations: expand-contract, double-write, backfill, blue-green. Triggers: migration, schema change, backfill, ALTER TABLE, online DDL.
131
129
  - **model-routing-patterns**: Multi-model pipelines (Haiku/Sonnet/Opus): cost routing, escalation, fallback chains. Triggers: model routing, Haiku, Sonnet, Opus, escalation, fallback chain.
132
130
  - **night-watch**: Autonomous maintenance (dep updates, dead code, small refactors) in isolated branch, off-hours. Triggers: night watch, autonomous maintenance, dep updates.
133
- - **observability-patterns**: Observability: structured logs, metrics (RED/USE), tracing (OpenTelemetry), SLO/SLI. Triggers: logging, metrics, Prometheus, Grafana, OpenTelemetry, trace, span, monitoring, alerting.
131
+ - **observability-patterns**: Observability: structured logs, metrics (RED/USE), tracing, SLO/SLI. Triggers: logging, metrics, Prometheus, Grafana, OpenTelemetry, trace, monitoring.
134
132
  - **onboard**: Sets up ai-toolkit in a project: symlinks, CLAUDE.md, intent interview. Triggers: onboard, setup project, install ai-toolkit, migrate project.
135
133
  - **orchestrate**: Coordinates multiple specialized agents in parallel. Triggers: orchestrate, multi-agent, parallel agents, coordinate agents.
136
134
  - **panic**: Emergency kill switch — halts all agents via lockfile gate. Triggers: panic, stop everything, kill switch, halt agents, agents looping.
137
- - **performance-profiling**: Performance: golden signals (latency/traffic/errors/saturation), p50/p95/p99, flame graphs, load testing. Triggers: performance, slow, latency, p99, flame graph, bottleneck, load test, memory leak.
135
+ - **performance-profiling**: Performance: golden signals, p50/p95/p99, flame graphs, load testing. Triggers: performance, slow, latency, p99, flame graph, bottleneck, memory leak.
138
136
  - **persona**: Switches engineering persona at runtime. Triggers: persona, switch role, backend-lead, frontend-lead, devops-eng, junior-dev.
139
137
  - **php-rules**: PHP coding rules: style, patterns, security, testing. Triggers: .php, composer.json, Laravel, Symfony, PHPUnit, PSR-12, Composer.
140
138
  - **plan**: Breaks features/goals into phased plans with task lists, agent assignments, dependencies. Triggers: plan feature, implementation roadmap, break down task, project phases.
141
- - **plan-writing**: Implementation plans + pre-mortems: phases, success criteria, risks, rollback, acceptance tests. Triggers: implementation plan, pre-mortem, phased plan, task breakdown, risk register.
142
139
  - **plugin-creator**: Creates opt-in plugin packs with manifests + module scaffolding for Claude/Codex. Triggers: new plugin, plugin pack, plugin scaffold.
143
140
  - **pr**: Creates GitHub PR after pre-flight checks (lint/typecheck/tests), structured summary from commits. Triggers: pr, pull request, create PR, ready to merge.
144
141
  - **prd-to-issues**: Splits a PRD into vertical-slice GitHub issues with HITL/AFK tagging and dependencies. Triggers: PRD to issues, create tickets, break down PRD, work items.
@@ -151,14 +148,13 @@
151
148
  - **refactor**: Refactors code for quality and maintainability. Triggers: refactor, clean up, restructure, improve code, modernize.
152
149
  - **refactor-plan**: Creates detailed refactor plan with tiny commits via interview, files as GitHub RFC. Triggers: refactor plan, refactoring RFC, incremental refactor, safe steps.
153
150
  - **repeat**: Runs prompt/slash command on recurring interval until done or limit. Triggers: repeat, recurring task, poll status, run every N minutes, interval.
154
- - **research-mastery**: Hierarchical retrieval: KB first (smart_query/crag_search), then MCP/Context7, then web. Triggers: research, fact-check, verify, synthesize, cross-reference, multi-source, investigate, cite sources.
151
+ - **research-mastery**: Hierarchical retrieval: KB MCP/Context7 web. Triggers: research, fact-check, verify, synthesize, cross-reference, multi-source, cite sources.
155
152
  - **review**: Reviews code for quality, security, correctness. Triggers: code review, quality review, security review, review PR, review branch.
156
153
  - **rollback**: Rolls back git commit, DB migration, or deploy to known-good with safety + health checks. Triggers: rollback, revert deploy, revert migration, rollback commit, git revert.
157
154
  - **ruby-patterns**: Ruby/Rails: blocks, metaprogramming, ActiveRecord, Sidekiq, RSpec, Sorbet, Hanami. Triggers: Ruby, Rails, ActiveRecord, Sidekiq, RSpec, Gemfile, bundler, Hanami, Sorbet.
158
155
  - **ruby-rules**: Ruby coding rules: style, patterns, security, testing. Triggers: .rb, Gemfile, .gemspec, Rails, ActiveRecord, Sidekiq, RSpec, Sorbet, rubocop.
159
156
  - **rust-patterns**: Rust: ownership, lifetimes, async (Tokio), Result/anyhow/thiserror, traits, unsafe. Triggers: Rust, borrow checker, lifetime, Tokio, cargo, trait, impl, Result, unsafe, clippy.
160
157
  - **rust-rules**: Rust coding rules: style, patterns, security, testing. Triggers: .rs, Cargo.toml, Cargo.lock, Tokio, Axum, Serde, clippy, cargo test.
161
- - **search**: Searches the KB with semantic + hybrid modes. Triggers: search KB, semantic search, hybrid search, knowledge base query.
162
158
  - **security-patterns**: App security: OWASP, authN/authZ, input validation, secrets, TLS, CSRF/XSS/SQLi, JWT, CSP. Triggers: security, OWASP, auth, JWT, CSRF, XSS, SQL injection, secrets, TLS, CSP, CORS.
163
159
  - **seo-validate**: SEO validator: meta/OG, Schema.org, hreflang, Core Web Vitals, crawlability. Triggers: SEO, meta tags, Schema.org, hreflang, LCP, INP, CLS, Core Web Vitals, sitemap, crawlability.
164
160
  - **skill-audit**: Scans skills/agents for security risks: dangerous patterns, secrets, excessive perms. Triggers: skill audit, security scan, agent audit, dangerous pattern.
@@ -168,11 +164,10 @@
168
164
  - **swift-patterns**: Swift/iOS: SwiftUI, Combine, async/await, actors, SPM, Core Data, UIKit interop. Triggers: Swift, SwiftUI, Combine, iOS, Xcode, actor, Core Data, @MainActor, @State.
169
165
  - **swift-rules**: Swift coding rules: style, patterns, security, testing. Triggers: .swift, Package.swift, .xcodeproj, SwiftUI, Combine, async/await, XCTest.
170
166
  - **tdd**: TDD with red-green-refactor loop and vertical slices. Triggers: TDD, test-first, red-green-refactor, test driving development.
171
- - **teams**: Launches multi-agent teams for review, debugging, feature dev, security audits, migrations. Triggers: multi-agent workflow, agent teams, team review, parallel agent collaboration.
172
167
  - **test**: Runs project test suite with coverage, auto-detects framework (pytest, vitest, jest, flutter, go, cargo, phpunit). Triggers: run tests, test suite, coverage report.
173
168
  - **testing-patterns**: Testing strategy: pyramid, AAA, mocks/fakes/stubs, flaky tests, coverage. Triggers: test, fixture, mock, stub, e2e, TDD, Playwright, Cypress, flaky, coverage, property-based.
174
169
  - **triage-issue**: Bug triage: explores codebase for root cause, files GitHub issue with TDD fix plan. Triggers: triage, investigate bug, fix plan, root cause, file issue, bug report.
175
- - **typescript-patterns**: TypeScript type safety: generics, conditional types, discriminated unions, Zod, satisfies, branded types. Triggers: TypeScript, TS, generics, Zod, satisfies, type narrowing, strict mode.
170
+ - **typescript-patterns**: TypeScript types: generics, discriminated unions, Zod, satisfies, branded types. Triggers: TypeScript, TS, generics, Zod, satisfies, strict mode.
176
171
  - **typescript-rules**: TypeScript/JavaScript coding rules: style, patterns, security, testing. Triggers: .ts, .tsx, .js, .jsx, package.json, tsconfig.json, React, Next.js, Vue, Vite, Vitest, Jest, ESLint.
177
172
  - **ubiquitous-language**: Extracts DDD ubiquitous language glossary, flags ambiguities, saves to UBIQUITOUS_LANGUAGE.md. Triggers: define domain terms, build glossary, harden terminology, DDD, domain model.
178
173
  - **verification-before-completion**: Forces verification commands before success claims. Evidence before assertions. Triggers: complete, fixed, passing, done, ready, verified.
@@ -5453,7 +5448,7 @@ python3 scripts/audit_skills.py --ci
5453
5448
  **Verify audit_skills.py:**
5454
5449
  - [ ] `HIGH: 0` (MUST be zero — CI fails otherwise)
5455
5450
  - [ ] `WARN: 0`
5456
- - [ ] `INFO: N` (acceptable — broad-access skills: orchestrate, swarm, teams)
5451
+ - [ ] `INFO: N` (acceptable — broad-access skills: orchestrate, swarm, workflow)
5457
5452
 
5458
5453
  ---
5459
5454
 
@@ -7007,7 +7002,6 @@ The main adapted group is multi-agent orchestration:
7007
7002
  - `/orchestrate`
7008
7003
  - `/workflow`
7009
7004
  - `/swarm`
7010
- - `/teams`
7011
7005
  - `/subagent-development`
7012
7006
 
7013
7007
  The adapter also covers skills that previously depended only on Claude's
@@ -10650,7 +10644,7 @@ User-authored opencode files and user-authored `opencode.json` keys are never de
10650
10644
  ## Behavioral Limits
10651
10645
 
10652
10646
  - opencode does not expose the full Claude hook event surface; only the events in the mapping table above are bridged. Claude-only events (`TaskCompleted`, `TeammateIdle`, `SubagentStart`, `SubagentStop`, `PreCompact`) are silently skipped.
10653
- - Multi-agent orchestration skills (`/orchestrate`, `/workflow`, `/swarm`, `/teams`, `/subagent-development`) run through the Codex adaptation layer — they use opencode subagents and explicit file ownership instead of Claude's `Agent`/`TaskCreate` primitives.
10647
+ - Multi-agent orchestration skills (`/orchestrate`, `/workflow`, `/swarm`, `/subagent-development`) run through the Codex adaptation layer — they use opencode subagents and explicit file ownership instead of Claude's `Agent`/`TaskCreate` primitives.
10654
10648
 
10655
10649
  ## Verification
10656
10650
 
@@ -10997,7 +10991,7 @@ All functionality is unified under skills. Task and hybrid skills are user-invoc
10997
10991
  | **2 — Multi-agent workflow** | `/workflow <type>` | Cross-cutting task with known pattern |
10998
10992
  | **3 — Custom parallelism** | `/orchestrate`, `/swarm` | No predefined workflow matches |
10999
10993
 
11000
- ## Task Skills (32)
10994
+ ## Task Skills (30)
11001
10995
 
11002
10996
  Task skills execute a specific action. Invoked via slash commands. `disable-model-invocation: true`.
11003
10997
 
@@ -11050,13 +11044,11 @@ Hybrid skills combine slash-command invocation with domain knowledge that agents
11050
11044
  | **analyze** | `/analyze` | medium | Analyze code quality, complexity, and patterns |
11051
11045
  | **cve-scan** | `/cve-scan` | medium | Scan project dependencies for known CVEs using native audit tools (npm, pip, composer, cargo, go, ruby, dart) |
11052
11046
  | **docs** | `/docs` | high | Generate/update docs: README, API docs, architecture notes, changelogs (Tier 1 — single agent) |
11053
- | **search** | `/search` | medium | Search knowledge base (MCP tools with local fallback) |
11054
11047
  | **explain** | `/explain` | medium | Explain architecture of a file/module using Mermaid diagrams |
11055
11048
  | **orchestrate** | `/orchestrate` | max | Custom multi-agent parallelism — Tier 3, native in Claude, Codex-adapted to `spawn_agent` workflows |
11056
11049
  | **swarm** | `/swarm` | max | Massive parallelism: map-reduce, consensus, relay — Tier 3 |
11057
11050
  | **workflow** | `/workflow` | max | 15 predefined multi-agent workflow types — Tier 2, Codex-adapted to native subagent orchestration |
11058
11051
  | **instinct-review** | `/instinct-review` | low | Review, curate, and manage learned instincts from past sessions |
11059
- | **teams** | `/teams` | max | Launch pre-configured Agent Teams compositions for common workflows |
11060
11052
  | **write-a-prd** | `/write-a-prd` | high | Create PRD through interactive interview, codebase exploration, and module design |
11061
11053
  | **prd-to-plan** | `/prd-to-plan` | high | Convert PRD into phased implementation plan using tracer-bullet vertical slices |
11062
11054
  | **tdd** | `/tdd` | high | Test-driven development with red-green-refactor loop and vertical slices |
@@ -11137,24 +11129,16 @@ Hybrid skills combine slash-command invocation with domain knowledge that agents
11137
11129
  | **content-moderation-patterns** | `skills/content-moderation-patterns/` | Two-stage moderation: pre-filter + LLM classifier; categories; thresholds |
11138
11130
  | **model-routing-patterns** | `skills/model-routing-patterns/` | Haiku/Sonnet/Opus routing; escalation; sub-agent delegation; fallback |
11139
11131
 
11140
- ## Knowledge Skills - Process (7)
11132
+ ## Knowledge Skills - Process (5)
11141
11133
 
11142
11134
  | Skill | Directory | Domain |
11143
11135
  |-------|-----------|--------|
11144
- | **plan-writing** | `skills/plan-writing/` | Implementation plans, success criteria, pre-mortem |
11145
- | **debugging-tactics** | `skills/debugging-tactics/` | Iron Law 4-phase debugging: root cause → pattern → hypothesis → fix |
11146
11136
  | **git-mastery** | `skills/git-mastery/` | Git workflows, branching, conflict resolution |
11147
11137
  | **architecture-decision** | `skills/architecture-decision/` | Architecture notes, trade-off analysis, alternatives |
11148
11138
  | **performance-profiling** | `skills/performance-profiling/` | Profiling, bottleneck analysis, optimization |
11149
11139
  | **research-mastery** | `skills/research-mastery/` | Multi-source research, synthesis, fact-checking |
11150
11140
  | **verification-before-completion** | `skills/verification-before-completion/` | Iron Law: evidence-before-claims, no completion without fresh verification |
11151
11141
 
11152
- ## Knowledge Skills - Orchestration (1)
11153
-
11154
- | Skill | Directory | Domain |
11155
- |-------|-----------|--------|
11156
- | **hive-mind** | `skills/hive-mind/` | Multi-agent aggregation, consensus, swarm patterns |
11157
-
11158
11142
  ## Quality Guardrails
11159
11143
 
11160
11144
  ### Anti-Rationalization Tables
@@ -11246,7 +11230,6 @@ Common adapted skills:
11246
11230
  - `/orchestrate`
11247
11231
  - `/workflow`
11248
11232
  - `/swarm`
11249
- - `/teams`
11250
11233
  - `/subagent-development`
11251
11234
  - `/tdd`
11252
11235
 
package/manifest.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "3.5.0",
2
+ "version": "4.0.0",
3
3
  "components": {
4
4
  "agents": {
5
5
  "description": "44 specialized agents (orchestrator, backend, frontend, security, devops, etc.)",
@@ -9,7 +9,7 @@
9
9
  "tags": ["core", "agents"]
10
10
  },
11
11
  "skills": {
12
- "description": "112 skills (32 task + 31 hybrid + 49 knowledge)",
12
+ "description": "107 skills (30 task + 31 hybrid + 46 knowledge)",
13
13
  "path": "app/skills",
14
14
  "target": ".claude/skills",
15
15
  "type": "symlink",
@@ -90,7 +90,7 @@
90
90
  "default": true
91
91
  },
92
92
  "skills": {
93
- "description": "112 skills (task, hybrid, knowledge)",
93
+ "description": "107 skills (task, hybrid, knowledge)",
94
94
  "default": true
95
95
  },
96
96
  "rules-common": {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@softspark/ai-toolkit",
3
- "version": "3.5.0",
4
- "description": "AI coding toolkit: 112 skills, 44 agents, 12-editor write-through (Claude, Cursor, Windsurf, Copilot, Gemini, Cline, Roo, Aider, Augment, Antigravity, Codex, opencode), machine-enforced safety constitution, SARIF audit, signed npm provenance.",
3
+ "version": "4.0.0",
4
+ "description": "AI coding toolkit: 107 skills, 44 agents, 12-editor write-through (Claude, Cursor, Windsurf, Copilot, Gemini, Cline, Roo, Aider, Augment, Antigravity, Codex, opencode), machine-enforced safety constitution, SARIF audit, signed npm provenance.",
5
5
  "keywords": [
6
6
  "claude",
7
7
  "claude-code",
@@ -98,7 +98,7 @@ def build_codex_skill_text(skill_file: Path) -> str:
98
98
 
99
99
  if adapted:
100
100
  frontmatter = _adapt_frontmatter(frontmatter)
101
- body = _adapt_body(skill_file.parent.name, body)
101
+ body = _adapt_body(body)
102
102
 
103
103
  rendered_frontmatter = _render_frontmatter(frontmatter)
104
104
  return f"---\n{rendered_frontmatter}\n---\n{body.rstrip()}\n"
@@ -221,7 +221,7 @@ def _adapt_allowed_tools(value: str) -> list[str]:
221
221
  return tools
222
222
 
223
223
 
224
- def _adapt_body(skill_name: str, body: str) -> str:
224
+ def _adapt_body(body: str) -> str:
225
225
  body = body.replace(
226
226
  "## MANDATORY: You MUST use the Agent tool",
227
227
  "## MANDATORY: Use Codex subagents for delegation",
@@ -258,11 +258,6 @@ def _adapt_body(skill_name: str, body: str) -> str:
258
258
  if "$ARGUMENTS" in body:
259
259
  body = body.replace("$ARGUMENTS", f"$ARGUMENTS\n{_CODEX_NOTE.rstrip()}", 1)
260
260
 
261
- if skill_name == "teams":
262
- body = body.replace(
263
- "Launches a pre-configured Agent Teams composition for your task.",
264
- "Launches a pre-configured Codex subagent composition for your task.",
265
- )
266
261
  return body
267
262
 
268
263
 
@@ -1,136 +0,0 @@
1
- ---
2
- name: debugging-tactics
3
- description: "RCA debugging: investigation, hypothesis, validation, fix. No fix without RCA. Triggers: bug, error, exception, stack trace, intermittent, flaky, crash, regression, broken after."
4
- effort: medium
5
- user-invocable: false
6
- allowed-tools: Grep, Read
7
- ---
8
-
9
- # Debugging Tactics Skill
10
-
11
- ## The Iron Law
12
-
13
- ```
14
- NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST
15
- ```
16
-
17
- If you haven't completed Phase 1 (Root Cause Investigation), you cannot propose fixes.
18
-
19
- Random fixes waste time and create new bugs. Quick patches mask underlying issues.
20
-
21
- **Violating the letter of this process is violating the spirit of debugging.**
22
-
23
- ## The Four Phases
24
-
25
- You MUST complete each phase before proceeding to the next.
26
-
27
- ### Phase 1: Root Cause Investigation
28
-
29
- **BEFORE attempting ANY fix:**
30
-
31
- 1. **Read Error Messages Carefully**
32
- - Don't skip past errors or warnings — they often contain the answer
33
- - Read stack traces completely
34
- - Note line numbers, file paths, error codes
35
-
36
- 2. **Reproduce Consistently**
37
- - Can you trigger it reliably?
38
- - What are the exact steps?
39
- - If not reproducible, gather more data — don't guess
40
-
41
- 3. **Check Recent Changes**
42
- - `git diff`, recent commits, new dependencies
43
- - Config changes, environmental differences
44
-
45
- 4. **Gather Evidence in Multi-Component Systems**
46
- For each component boundary: log what enters, log what exits, verify state at each layer.
47
- Run once to gather evidence showing WHERE it breaks, THEN investigate that specific component.
48
-
49
- 5. **Trace Data Flow**
50
- Where does the bad value originate? Trace backward through call stack to the source. Fix at source, not at symptom.
51
-
52
- ### Phase 2: Pattern Analysis
53
-
54
- 1. **Find Working Examples** — locate similar working code in same codebase
55
- 2. **Compare Against References** — read reference implementations COMPLETELY, not skimming
56
- 3. **Identify Differences** — list every difference, however small
57
- 4. **Understand Dependencies** — what other components, settings, config does this need?
58
-
59
- ### Phase 3: Hypothesis and Testing
60
-
61
- 1. **Form Single Hypothesis** — "I think X is the root cause because Y" (be specific)
62
- 2. **Test Minimally** — smallest possible change, one variable at a time
63
- 3. **Verify Before Continuing** — did it work? If not, form NEW hypothesis. Don't add more fixes on top.
64
-
65
- ### Phase 4: Implementation
66
-
67
- 1. **Create Failing Test Case** — MUST have before fixing (use TDD skill)
68
- 2. **Implement Single Fix** — address root cause, ONE change at a time, no "while I'm here" improvements
69
- 3. **Verify Fix** — test passes? No regressions? Issue resolved?
70
- 4. **If Fix Doesn't Work** — count your attempts:
71
- - If < 3: Return to Phase 1, re-analyze with new information
72
- - **If >= 3: STOP and question the architecture** (see below)
73
-
74
- ### Architecture Escalation (3+ Failed Fixes)
75
-
76
- **Pattern indicating architectural problem:**
77
- - Each fix reveals new shared state/coupling in different places
78
- - Fixes require "massive refactoring" to implement
79
- - Each fix creates new symptoms elsewhere
80
-
81
- **STOP and question fundamentals:**
82
- - Is this pattern fundamentally sound?
83
- - Should we refactor architecture vs. continue fixing symptoms?
84
- - Discuss with user before attempting more fixes
85
-
86
- This is NOT a failed hypothesis — this is a wrong architecture.
87
-
88
- ## Red Flags — STOP and Follow Process
89
-
90
- | Excuse | Reality |
91
- |--------|---------|
92
- | "Quick fix for now, investigate later" | Systematic is faster than thrashing |
93
- | "Just try changing X and see" | One variable at a time, with hypothesis |
94
- | "I'll skip the test, I'll manually verify" | Untested fixes don't stick |
95
- | "It's probably X, let me fix that" | Seeing symptoms is not understanding root cause |
96
- | "One more fix attempt" (after 2+) | 3+ failures = architectural problem. STOP. |
97
- | "Here are the main problems: [list]" | You're proposing fixes without investigation |
98
-
99
- ## Legacy Reference
100
-
101
- ## Language-Specific Tactics
102
-
103
- ### Python
104
- - **Debugger**: `import pdb; pdb.set_trace()` (or `ipdb`)
105
- - **Trace**: `traceback.print_stack()`
106
- - **Memory**: `tracemalloc` for leaks.
107
- ```python
108
- import tracemalloc
109
- tracemalloc.start()
110
- # ... code ...
111
- snapshot = tracemalloc.take_snapshot()
112
- top_stats = snapshot.statistics('lineno')
113
- ```
114
-
115
- ### Node.js / TypeScript
116
- - **Debugger**: `node --inspect-brk app.js` -> Open `chrome://inspect`.
117
- - **Memory**: `heapdump` or built-in inspector.
118
- - **Async Traces**: Ensure `Error.stackTraceLimit = Infinity`.
119
-
120
- ### PHP (Laravel/Symfony)
121
- - **Debugger**: Xdebug (`xdebug_break()`).
122
- - **Logs**: `Log::info('State:', $data);`.
123
- - **Query Log**: `DB::enableQueryLog(); ... dd(DB::getQueryLog());`.
124
-
125
- ### Flutter / Dart
126
- - **Debugger**: `debugger()` statement.
127
- - **Inspector**: Flutter DevTools (Widget Inspector).
128
- - **Network**: Network tab in DevTools for API calls.
129
-
130
- ## "5 Whys" Root Cause Analysis
131
- Ask "Why?" 5 times to find the real issue:
132
- - "The app crashed." -> Why? -> "Null pointer exception."
133
- - -> Why? -> "User object was null."
134
- - -> Why? -> "API returned 404."
135
- - -> Why? -> "User ID was invalid."
136
- - -> Why? -> "Frontend validation allowed negative IDs." (ROOT CAUSE)