@dv.nghiem/flowdeck 0.1.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/LICENSE +21 -0
- package/README.md +136 -0
- package/bin/flowdeck.js +108 -0
- package/dist/agents/architect.d.ts +3 -0
- package/dist/agents/architect.d.ts.map +1 -0
- package/dist/agents/code-explorer.d.ts +3 -0
- package/dist/agents/code-explorer.d.ts.map +1 -0
- package/dist/agents/coder.d.ts +3 -0
- package/dist/agents/coder.d.ts.map +1 -0
- package/dist/agents/debug.d.ts +4 -0
- package/dist/agents/debug.d.ts.map +1 -0
- package/dist/agents/doc-updater.d.ts +3 -0
- package/dist/agents/doc-updater.d.ts.map +1 -0
- package/dist/agents/flowdeck.d.ts +5 -0
- package/dist/agents/flowdeck.d.ts.map +1 -0
- package/dist/agents/index.d.ts +38 -0
- package/dist/agents/index.d.ts.map +1 -0
- package/dist/agents/mapper.d.ts +3 -0
- package/dist/agents/mapper.d.ts.map +1 -0
- package/dist/agents/orchestrator.d.ts +10 -0
- package/dist/agents/orchestrator.d.ts.map +1 -0
- package/dist/agents/performance.d.ts +4 -0
- package/dist/agents/performance.d.ts.map +1 -0
- package/dist/agents/planner.d.ts +3 -0
- package/dist/agents/planner.d.ts.map +1 -0
- package/dist/agents/policy-enforcer.d.ts +3 -0
- package/dist/agents/policy-enforcer.d.ts.map +1 -0
- package/dist/agents/researcher.d.ts +3 -0
- package/dist/agents/researcher.d.ts.map +1 -0
- package/dist/agents/reviewer.d.ts +3 -0
- package/dist/agents/reviewer.d.ts.map +1 -0
- package/dist/agents/risk-analyst.d.ts +3 -0
- package/dist/agents/risk-analyst.d.ts.map +1 -0
- package/dist/agents/security-auditor.d.ts +3 -0
- package/dist/agents/security-auditor.d.ts.map +1 -0
- package/dist/agents/specialist.d.ts +5 -0
- package/dist/agents/specialist.d.ts.map +1 -0
- package/dist/agents/tester.d.ts +3 -0
- package/dist/agents/tester.d.ts.map +1 -0
- package/dist/agents/types.d.ts +20 -0
- package/dist/agents/types.d.ts.map +1 -0
- package/dist/agents/writer.d.ts +3 -0
- package/dist/agents/writer.d.ts.map +1 -0
- package/dist/commands/analysis/analysis.test.d.ts +2 -0
- package/dist/commands/analysis/analysis.test.d.ts.map +1 -0
- package/dist/commands/analysis/analyze-change.d.ts +148 -0
- package/dist/commands/analysis/analyze-change.d.ts.map +1 -0
- package/dist/commands/analysis/evaluate-risk.d.ts +77 -0
- package/dist/commands/analysis/evaluate-risk.d.ts.map +1 -0
- package/dist/commands/analysis/guarded-edit.d.ts +72 -0
- package/dist/commands/analysis/guarded-edit.d.ts.map +1 -0
- package/dist/commands/execution/deploy-check.d.ts +91 -0
- package/dist/commands/execution/deploy-check.d.ts.map +1 -0
- package/dist/commands/execution/fix-bug.d.ts +187 -0
- package/dist/commands/execution/fix-bug.d.ts.map +1 -0
- package/dist/commands/execution/new-feature.d.ts +171 -0
- package/dist/commands/execution/new-feature.d.ts.map +1 -0
- package/dist/commands/execution/review-code.d.ts +130 -0
- package/dist/commands/execution/review-code.d.ts.map +1 -0
- package/dist/commands/execution/write-docs.d.ts +94 -0
- package/dist/commands/execution/write-docs.d.ts.map +1 -0
- package/dist/commands/governance/approve.d.ts +80 -0
- package/dist/commands/governance/approve.d.ts.map +1 -0
- package/dist/commands/intelligence/blast-radius.d.ts +67 -0
- package/dist/commands/intelligence/blast-radius.d.ts.map +1 -0
- package/dist/commands/intelligence/impact-radar.d.ts +71 -0
- package/dist/commands/intelligence/impact-radar.d.ts.map +1 -0
- package/dist/commands/intelligence/intelligence.test.d.ts +2 -0
- package/dist/commands/intelligence/intelligence.test.d.ts.map +1 -0
- package/dist/commands/intelligence/regression-predict.d.ts +75 -0
- package/dist/commands/intelligence/regression-predict.d.ts.map +1 -0
- package/dist/commands/intelligence/review-route.d.ts +65 -0
- package/dist/commands/intelligence/review-route.d.ts.map +1 -0
- package/dist/commands/intelligence/test-gap.d.ts +73 -0
- package/dist/commands/intelligence/test-gap.d.ts.map +1 -0
- package/dist/commands/intelligence/translate-intent.d.ts +87 -0
- package/dist/commands/intelligence/translate-intent.d.ts.map +1 -0
- package/dist/commands/intelligence/volatility-map-cmd.d.ts +68 -0
- package/dist/commands/intelligence/volatility-map-cmd.d.ts.map +1 -0
- package/dist/commands/planning/ask.d.ts +62 -0
- package/dist/commands/planning/ask.d.ts.map +1 -0
- package/dist/commands/planning/ask.test.d.ts +2 -0
- package/dist/commands/planning/ask.test.d.ts.map +1 -0
- package/dist/commands/planning/dashboard.d.ts +30 -0
- package/dist/commands/planning/dashboard.d.ts.map +1 -0
- package/dist/commands/planning/discuss.d.ts +39 -0
- package/dist/commands/planning/discuss.d.ts.map +1 -0
- package/dist/commands/planning/plan.d.ts +67 -0
- package/dist/commands/planning/plan.d.ts.map +1 -0
- package/dist/commands/planning/roadmap.d.ts +105 -0
- package/dist/commands/planning/roadmap.d.ts.map +1 -0
- package/dist/commands/setup/doctor.d.ts +10 -0
- package/dist/commands/setup/doctor.d.ts.map +1 -0
- package/dist/commands/setup/map-codebase.d.ts +62 -0
- package/dist/commands/setup/map-codebase.d.ts.map +1 -0
- package/dist/commands/setup/new-project.d.ts +19 -0
- package/dist/commands/setup/new-project.d.ts.map +1 -0
- package/dist/commands/setup/settings.d.ts +57 -0
- package/dist/commands/setup/settings.d.ts.map +1 -0
- package/dist/commands/state/checkpoint.d.ts +27 -0
- package/dist/commands/state/checkpoint.d.ts.map +1 -0
- package/dist/commands/state/multi-repo.d.ts +63 -0
- package/dist/commands/state/multi-repo.d.ts.map +1 -0
- package/dist/commands/state/progress.d.ts +57 -0
- package/dist/commands/state/progress.d.ts.map +1 -0
- package/dist/commands/state/resume.d.ts +11 -0
- package/dist/commands/state/resume.d.ts.map +1 -0
- package/dist/commands/state/workspace-commands.d.ts +207 -0
- package/dist/commands/state/workspace-commands.d.ts.map +1 -0
- package/dist/dashboard/lib/port-finder.d.ts +10 -0
- package/dist/dashboard/lib/port-finder.d.ts.map +1 -0
- package/dist/dashboard/lib/port-finder.test.d.ts +2 -0
- package/dist/dashboard/lib/port-finder.test.d.ts.map +1 -0
- package/dist/dashboard/lib/state-reader.d.ts +3 -0
- package/dist/dashboard/lib/state-reader.d.ts.map +1 -0
- package/dist/dashboard/server.d.ts +2 -0
- package/dist/dashboard/server.d.ts.map +1 -0
- package/dist/dashboard/server.mjs +13649 -0
- package/dist/dashboard/types.d.ts +72 -0
- package/dist/dashboard/types.d.ts.map +1 -0
- package/dist/dashboard/views/index.ejs +391 -0
- package/dist/dashboard/views/partials/blockers.ejs +10 -0
- package/dist/dashboard/views/partials/header.ejs +20 -0
- package/dist/dashboard/views/partials/phase-timeline.ejs +40 -0
- package/dist/dashboard/views/partials/progress.ejs +12 -0
- package/dist/hooks/approval-hook.d.ts +13 -0
- package/dist/hooks/approval-hook.d.ts.map +1 -0
- package/dist/hooks/compaction-hook.d.ts +23 -0
- package/dist/hooks/compaction-hook.d.ts.map +1 -0
- package/dist/hooks/context-window-monitor.d.ts +21 -0
- package/dist/hooks/context-window-monitor.d.ts.map +1 -0
- package/dist/hooks/decision-trace-hook.d.ts +13 -0
- package/dist/hooks/decision-trace-hook.d.ts.map +1 -0
- package/dist/hooks/file-tracker.d.ts +29 -0
- package/dist/hooks/file-tracker.d.ts.map +1 -0
- package/dist/hooks/guard-rails.d.ts +33 -0
- package/dist/hooks/guard-rails.d.ts.map +1 -0
- package/dist/hooks/index.d.ts +5 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/notifications.d.ts +21 -0
- package/dist/hooks/notifications.d.ts.map +1 -0
- package/dist/hooks/patch-trust.d.ts +27 -0
- package/dist/hooks/patch-trust.d.ts.map +1 -0
- package/dist/hooks/patch-trust.test.d.ts +2 -0
- package/dist/hooks/patch-trust.test.d.ts.map +1 -0
- package/dist/hooks/session-events.d.ts +8 -0
- package/dist/hooks/session-events.d.ts.map +1 -0
- package/dist/hooks/session-idle-hook.d.ts +21 -0
- package/dist/hooks/session-idle-hook.d.ts.map +1 -0
- package/dist/hooks/session-start.d.ts +10 -0
- package/dist/hooks/session-start.d.ts.map +1 -0
- package/dist/hooks/shell-env-hook.d.ts +21 -0
- package/dist/hooks/shell-env-hook.d.ts.map +1 -0
- package/dist/hooks/telemetry-hook.d.ts +25 -0
- package/dist/hooks/telemetry-hook.d.ts.map +1 -0
- package/dist/hooks/todo-hook.d.ts +25 -0
- package/dist/hooks/todo-hook.d.ts.map +1 -0
- package/dist/hooks/tool-guard.d.ts +41 -0
- package/dist/hooks/tool-guard.d.ts.map +1 -0
- package/dist/hooks/tool-guard.test.d.ts +2 -0
- package/dist/hooks/tool-guard.test.d.ts.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6639 -0
- package/dist/lib/confirmation.d.ts +20 -0
- package/dist/lib/confirmation.d.ts.map +1 -0
- package/dist/lib/impact-radar.d.ts +35 -0
- package/dist/lib/impact-radar.d.ts.map +1 -0
- package/dist/lib/signatures.d.ts +12 -0
- package/dist/lib/signatures.d.ts.map +1 -0
- package/dist/lib/timestamps.d.ts +23 -0
- package/dist/lib/timestamps.d.ts.map +1 -0
- package/dist/mcp/index.d.ts +20 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/services/agent-performance.d.ts +29 -0
- package/dist/services/agent-performance.d.ts.map +1 -0
- package/dist/services/approval-manager.d.ts +30 -0
- package/dist/services/approval-manager.d.ts.map +1 -0
- package/dist/services/index.d.ts +7 -0
- package/dist/services/index.d.ts.map +1 -0
- package/dist/services/model-router.d.ts +35 -0
- package/dist/services/model-router.d.ts.map +1 -0
- package/dist/services/policy-compiler.d.ts +27 -0
- package/dist/services/policy-compiler.d.ts.map +1 -0
- package/dist/services/run-trace.d.ts +34 -0
- package/dist/services/run-trace.d.ts.map +1 -0
- package/dist/services/services.test.d.ts +2 -0
- package/dist/services/services.test.d.ts.map +1 -0
- package/dist/services/telemetry.d.ts +34 -0
- package/dist/services/telemetry.d.ts.map +1 -0
- package/dist/tools/agent-dispatch.test.d.ts +2 -0
- package/dist/tools/agent-dispatch.test.d.ts.map +1 -0
- package/dist/tools/codebase-state.d.ts +4 -0
- package/dist/tools/codebase-state.d.ts.map +1 -0
- package/dist/tools/context-generator.d.ts +3 -0
- package/dist/tools/context-generator.d.ts.map +1 -0
- package/dist/tools/council.d.ts +4 -0
- package/dist/tools/council.d.ts.map +1 -0
- package/dist/tools/decision-trace.d.ts +16 -0
- package/dist/tools/decision-trace.d.ts.map +1 -0
- package/dist/tools/delegate.d.ts +4 -0
- package/dist/tools/delegate.d.ts.map +1 -0
- package/dist/tools/failure-replay.d.ts +19 -0
- package/dist/tools/failure-replay.d.ts.map +1 -0
- package/dist/tools/failure-replay.test.d.ts +2 -0
- package/dist/tools/failure-replay.test.d.ts.map +1 -0
- package/dist/tools/hash-edit.d.ts +3 -0
- package/dist/tools/hash-edit.d.ts.map +1 -0
- package/dist/tools/planning-state-lib.d.ts +65 -0
- package/dist/tools/planning-state-lib.d.ts.map +1 -0
- package/dist/tools/planning-state.d.ts +3 -0
- package/dist/tools/planning-state.d.ts.map +1 -0
- package/dist/tools/policy-engine.d.ts +19 -0
- package/dist/tools/policy-engine.d.ts.map +1 -0
- package/dist/tools/repo-memory.d.ts +20 -0
- package/dist/tools/repo-memory.d.ts.map +1 -0
- package/dist/tools/repo-memory.test.d.ts +2 -0
- package/dist/tools/repo-memory.test.d.ts.map +1 -0
- package/dist/tools/run-parallel.d.ts +4 -0
- package/dist/tools/run-parallel.d.ts.map +1 -0
- package/dist/tools/run-pipeline.d.ts +4 -0
- package/dist/tools/run-pipeline.d.ts.map +1 -0
- package/dist/tools/volatility-map.d.ts +18 -0
- package/dist/tools/volatility-map.d.ts.map +1 -0
- package/dist/tools/volatility-map.test.d.ts +2 -0
- package/dist/tools/volatility-map.test.d.ts.map +1 -0
- package/dist/tools/workspace-state.d.ts +3 -0
- package/dist/tools/workspace-state.d.ts.map +1 -0
- package/docs/USER_GUIDE.md +20 -0
- package/docs/agents.md +562 -0
- package/docs/best-practices.md +47 -0
- package/docs/command-migration.md +175 -0
- package/docs/commands/fd-analyze-change.md +107 -0
- package/docs/commands/fd-ask.md +51 -0
- package/docs/commands/fd-checkpoint.md +10 -0
- package/docs/commands/fd-dashboard.md +11 -0
- package/docs/commands/fd-deploy-check.md +11 -0
- package/docs/commands/fd-discuss.md +28 -0
- package/docs/commands/fd-evaluate-risk.md +134 -0
- package/docs/commands/fd-fix-bug.md +24 -0
- package/docs/commands/fd-guarded-edit.md +105 -0
- package/docs/commands/fd-map-codebase.md +27 -0
- package/docs/commands/fd-multi-repo.md +63 -0
- package/docs/commands/fd-new-feature.md +25 -0
- package/docs/commands/fd-new-project.md +24 -0
- package/docs/commands/fd-plan.md +33 -0
- package/docs/commands/fd-progress.md +11 -0
- package/docs/commands/fd-resume.md +10 -0
- package/docs/commands/fd-review-code.md +29 -0
- package/docs/commands/fd-roadmap.md +10 -0
- package/docs/commands/fd-settings.md +10 -0
- package/docs/commands/fd-write-docs.md +10 -0
- package/docs/commands.md +476 -0
- package/docs/configuration.md +211 -0
- package/docs/feature-integration-architecture.md +255 -0
- package/docs/index.md +75 -0
- package/docs/installation.md +134 -0
- package/docs/intelligence.md +294 -0
- package/docs/multi-repo.md +201 -0
- package/docs/notifications.md +170 -0
- package/docs/parallel-execution.md +227 -0
- package/docs/quick-start.md +174 -0
- package/docs/rules.md +459 -0
- package/docs/skills.md +408 -0
- package/docs/workflows.md +376 -0
- package/package.json +58 -0
- package/postinstall.mjs +102 -0
- package/src/rules/README.md +37 -0
- package/src/rules/common/agent-orchestration.md +86 -0
- package/src/rules/common/coding-style.md +120 -0
- package/src/rules/common/git-workflow.md +77 -0
- package/src/rules/common/security.md +94 -0
- package/src/rules/common/testing.md +105 -0
- package/src/rules/golang/patterns.md +187 -0
- package/src/rules/java/patterns.md +204 -0
- package/src/rules/python/patterns.md +141 -0
- package/src/rules/rust/patterns.md +210 -0
- package/src/rules/typescript/patterns.md +168 -0
- package/src/skills/api-design/SKILL.md +143 -0
- package/src/skills/arch-constraint-guard/SKILL.md +61 -0
- package/src/skills/blast-radius-preview/SKILL.md +65 -0
- package/src/skills/change-impact-radar/SKILL.md +63 -0
- package/src/skills/code-review/SKILL.md +108 -0
- package/src/skills/code-tour/SKILL.md +101 -0
- package/src/skills/codebase-mapping/SKILL.md +87 -0
- package/src/skills/codebase-onboarding/SKILL.md +133 -0
- package/src/skills/confidence-aware-planning/SKILL.md +67 -0
- package/src/skills/context-load/SKILL.md +63 -0
- package/src/skills/debug-flow/SKILL.md +75 -0
- package/src/skills/decision-trace/SKILL.md +72 -0
- package/src/skills/dependency-audit/SKILL.md +126 -0
- package/src/skills/deploy-check/SKILL.md +87 -0
- package/src/skills/documentation-writer/SKILL.md +154 -0
- package/src/skills/failure-replay-engine/SKILL.md +59 -0
- package/src/skills/git-release/SKILL.md +94 -0
- package/src/skills/git-workflow/SKILL.md +177 -0
- package/src/skills/golang-patterns/SKILL.md +511 -0
- package/src/skills/human-review-routing/SKILL.md +65 -0
- package/src/skills/intent-translator/SKILL.md +57 -0
- package/src/skills/java-patterns/SKILL.md +479 -0
- package/src/skills/multi-repo/SKILL.md +187 -0
- package/src/skills/parallel-execute/SKILL.md +92 -0
- package/src/skills/patch-trust-score/SKILL.md +44 -0
- package/src/skills/performance-profiling/SKILL.md +153 -0
- package/src/skills/plan-task/SKILL.md +101 -0
- package/src/skills/python-patterns/SKILL.md +529 -0
- package/src/skills/refactor-guide/SKILL.md +117 -0
- package/src/skills/regression-prediction/SKILL.md +57 -0
- package/src/skills/repo-memory-graph/SKILL.md +49 -0
- package/src/skills/rust-patterns/SKILL.md +492 -0
- package/src/skills/security-scan/SKILL.md +91 -0
- package/src/skills/self-healing-policies/SKILL.md +76 -0
- package/src/skills/tdd-workflow/SKILL.md +126 -0
- package/src/skills/test-coverage/SKILL.md +94 -0
- package/src/skills/test-gap-detector/SKILL.md +58 -0
- package/src/skills/volatility-map/SKILL.md +52 -0
- package/src/workflows/debug-flow.md +119 -0
- package/src/workflows/deploy-check-flow.md +98 -0
- package/src/workflows/discuss-flow.md +97 -0
- package/src/workflows/execute-flow.md +233 -0
- package/src/workflows/execute-phase.md +142 -0
- package/src/workflows/fix-bug-flow.md +210 -0
- package/src/workflows/map-codebase-flow.md +92 -0
- package/src/workflows/multi-repo-flow.md +226 -0
- package/src/workflows/parallel-execution-flow.md +236 -0
- package/src/workflows/plan-flow.md +126 -0
- package/src/workflows/plan-phase.md +101 -0
- package/src/workflows/refactor-flow.md +122 -0
- package/src/workflows/review-code-flow.md +105 -0
- package/src/workflows/spec-driven-flow.md +43 -0
- package/src/workflows/write-docs-flow.md +95 -0
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: codebase-mapping
|
|
3
|
+
description: Systematic codebase exploration and documentation for agent context. Maps architecture, conventions, and file structure into .codebase/ files. Use when onboarding to a new project or before deep feature work.
|
|
4
|
+
origin: FlowDeck
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Codebase Mapping Skill
|
|
8
|
+
|
|
9
|
+
Produces structured documentation of a codebase that agents can read to answer "how does this project work?" without re-scanning every time.
|
|
10
|
+
|
|
11
|
+
## When to Activate
|
|
12
|
+
|
|
13
|
+
- Starting work on an unfamiliar codebase
|
|
14
|
+
- Before a major feature that spans multiple modules
|
|
15
|
+
- When `/map-codebase` command is invoked
|
|
16
|
+
- When `.codebase/` is missing or stale
|
|
17
|
+
|
|
18
|
+
## Output Files
|
|
19
|
+
|
|
20
|
+
All outputs go to `.codebase/`:
|
|
21
|
+
|
|
22
|
+
| File | Contents |
|
|
23
|
+
|------|----------|
|
|
24
|
+
| `ARCHITECTURE.md` | System design: layers, modules, data flow |
|
|
25
|
+
| `CONVENTIONS.md` | Naming, style, patterns specific to this project |
|
|
26
|
+
| `DEPENDENCIES.md` | Key external packages and what they do |
|
|
27
|
+
| `INDEX.md` | File-by-file inventory |
|
|
28
|
+
| `ENTRY_POINTS.md` | How the application starts and key entry files |
|
|
29
|
+
|
|
30
|
+
## Mapping Sequence
|
|
31
|
+
|
|
32
|
+
### Step 1: Start from the outside
|
|
33
|
+
|
|
34
|
+
Read in this order:
|
|
35
|
+
1. `package.json` / `pyproject.toml` / `Cargo.toml` — dependencies, scripts, metadata
|
|
36
|
+
2. `README.md` — stated purpose and architecture
|
|
37
|
+
3. Entry point files (main, index, app, server)
|
|
38
|
+
4. Configuration files (env examples, config schemas)
|
|
39
|
+
|
|
40
|
+
### Step 2: Map the directory structure
|
|
41
|
+
|
|
42
|
+
Document each top-level directory's purpose:
|
|
43
|
+
```
|
|
44
|
+
src/
|
|
45
|
+
api/ — HTTP route handlers
|
|
46
|
+
services/ — Business logic
|
|
47
|
+
models/ — Database schemas and queries
|
|
48
|
+
utils/ — Shared helpers
|
|
49
|
+
tests/ — Test files (mirror of src/)
|
|
50
|
+
scripts/ — Build and deployment scripts
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Do not guess. Read the files to confirm what each directory contains.
|
|
54
|
+
|
|
55
|
+
### Step 3: Document key conventions
|
|
56
|
+
|
|
57
|
+
Find examples in the code:
|
|
58
|
+
- How are errors handled? (throw? return Result? error callback?)
|
|
59
|
+
- How are modules exported? (default export? named exports?)
|
|
60
|
+
- What is the naming pattern for files? (`UserService.ts`? `user-service.ts`?)
|
|
61
|
+
- Where do interfaces/types live?
|
|
62
|
+
- How is dependency injection done?
|
|
63
|
+
|
|
64
|
+
Write 1-2 examples for each pattern, not a generic description.
|
|
65
|
+
|
|
66
|
+
### Step 4: Document entry points
|
|
67
|
+
|
|
68
|
+
```markdown
|
|
69
|
+
## Entry Points
|
|
70
|
+
|
|
71
|
+
- `src/index.ts` — Application bootstrap, registers routes and middleware
|
|
72
|
+
- `src/workers/queue.ts` — Background job processor, runs independently
|
|
73
|
+
- `scripts/migrate.ts` — Database migration runner
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Step 5: List key dependencies
|
|
77
|
+
|
|
78
|
+
For each significant dependency, document:
|
|
79
|
+
- What it is used for in this project
|
|
80
|
+
- Where in the codebase it is used
|
|
81
|
+
- Version (note if pinned due to known issues)
|
|
82
|
+
|
|
83
|
+
## Accuracy rules
|
|
84
|
+
|
|
85
|
+
- Only document what you have read — never document by assumption
|
|
86
|
+
- If a file's purpose is unclear, note "purpose unclear — investigate before modifying"
|
|
87
|
+
- Timestamp the mapping: `Last updated: [date]`
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: codebase-onboarding
|
|
3
|
+
description: Systematically explores and documents an unfamiliar codebase. Use when joining a new project, setting up for the first time, or generating project documentation.
|
|
4
|
+
origin: FlowDeck
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Codebase Onboarding Skill
|
|
8
|
+
|
|
9
|
+
Systematically maps an unfamiliar codebase into structured documentation. Factual only — no speculation.
|
|
10
|
+
|
|
11
|
+
## When to Activate
|
|
12
|
+
|
|
13
|
+
Activate when:
|
|
14
|
+
- Joining a new project for the first time
|
|
15
|
+
- A new AI agent needs to understand the codebase
|
|
16
|
+
- Project documentation is out of date or missing
|
|
17
|
+
- Before making major architectural changes
|
|
18
|
+
|
|
19
|
+
## Core Principles
|
|
20
|
+
|
|
21
|
+
- **Reconnaissance before action** — fully understand before touching anything
|
|
22
|
+
- **Factual, not speculative** — if uncertain, write `UNKNOWN — needs verification`
|
|
23
|
+
- **Document as you explore** — write findings immediately, before moving on
|
|
24
|
+
|
|
25
|
+
## Phase 1: Reconnaissance
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
# 1. Top-level structure
|
|
29
|
+
ls -la
|
|
30
|
+
|
|
31
|
+
# 2. Package manifest
|
|
32
|
+
cat package.json # Node.js
|
|
33
|
+
cat go.mod # Go
|
|
34
|
+
cat Cargo.toml # Rust
|
|
35
|
+
cat requirements.txt # Python
|
|
36
|
+
|
|
37
|
+
# 3. Entry points
|
|
38
|
+
find . -name "index.*" -o -name "main.*" | grep -v node_modules | grep -v dist | grep -v .git
|
|
39
|
+
|
|
40
|
+
# 4. Directory structure
|
|
41
|
+
find . -maxdepth 2 -type d | grep -v node_modules | grep -v .git | grep -v dist
|
|
42
|
+
|
|
43
|
+
# 5. Test structure
|
|
44
|
+
find . -name "*.test.*" -o -name "*.spec.*" | grep -v node_modules | head -20
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Findings:
|
|
48
|
+
- What framework is this? (Express, Next.js, FastAPI, etc.)
|
|
49
|
+
- Where does execution start?
|
|
50
|
+
- Where are the tests?
|
|
51
|
+
|
|
52
|
+
## Phase 2: Architecture Mapping
|
|
53
|
+
|
|
54
|
+
Read the most important files:
|
|
55
|
+
1. Main entry point — understand startup sequence
|
|
56
|
+
2. Route definitions — what APIs/endpoints exist?
|
|
57
|
+
3. Core data models — what are the key entities?
|
|
58
|
+
4. Database setup — what database, what ORM?
|
|
59
|
+
5. Auth setup — how is authentication handled?
|
|
60
|
+
|
|
61
|
+
Produce a component diagram:
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
Client
|
|
65
|
+
→ HTTP (port 3000)
|
|
66
|
+
→ Express Router (src/routes/)
|
|
67
|
+
→ Services (src/services/)
|
|
68
|
+
→ Repository (src/db/)
|
|
69
|
+
→ PostgreSQL
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Phase 3: Convention Detection
|
|
73
|
+
|
|
74
|
+
Read 5-10 source files and note patterns:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
# Naming conventions
|
|
78
|
+
grep -n "export function\|export const\|export class" src/ -r | head -20
|
|
79
|
+
|
|
80
|
+
# Error handling
|
|
81
|
+
grep -n "catch\|throw\|Error(" src/ -r | head -20
|
|
82
|
+
|
|
83
|
+
# Async patterns
|
|
84
|
+
grep -n "async\|await\|Promise" src/ -r | head -20
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Conventions to identify:
|
|
88
|
+
- Variable naming: camelCase, snake_case, or mixed?
|
|
89
|
+
- Import style: relative paths, aliases, or barrel exports?
|
|
90
|
+
- Error handling: throw, return Result, or callback?
|
|
91
|
+
- Async pattern: async/await, promises, or callbacks?
|
|
92
|
+
|
|
93
|
+
## Output Format
|
|
94
|
+
|
|
95
|
+
```markdown
|
|
96
|
+
# Codebase Onboarding: [Project Name]
|
|
97
|
+
|
|
98
|
+
## Phase 1: Reconnaissance
|
|
99
|
+
|
|
100
|
+
**Runtime**: Node.js v20 / Python 3.11 / Go 1.21
|
|
101
|
+
**Framework**: Express 4.18 / FastAPI / Echo
|
|
102
|
+
**Package manager**: npm / pip / cargo
|
|
103
|
+
**Entry point**: `src/index.ts:1`
|
|
104
|
+
**Test framework**: vitest / pytest / go test
|
|
105
|
+
|
|
106
|
+
## Phase 2: Architecture
|
|
107
|
+
|
|
108
|
+
**Pattern**: Layered (Routes → Services → Repository → Database)
|
|
109
|
+
**Database**: PostgreSQL via Prisma ORM
|
|
110
|
+
**Auth**: JWT via `src/middleware/auth.ts`
|
|
111
|
+
|
|
112
|
+
**Component Diagram**:
|
|
113
|
+
```
|
|
114
|
+
[diagram]
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
**Key Files**:
|
|
118
|
+
| File | Purpose |
|
|
119
|
+
|------|---------|
|
|
120
|
+
| `src/index.ts` | HTTP server startup |
|
|
121
|
+
| `src/routes/` | Route definitions |
|
|
122
|
+
| `src/services/` | Business logic |
|
|
123
|
+
|
|
124
|
+
## Phase 3: Conventions
|
|
125
|
+
|
|
126
|
+
**Naming**: camelCase for variables, PascalCase for types
|
|
127
|
+
**Imports**: relative paths within module, `@/` alias for cross-module
|
|
128
|
+
**Error handling**: throws `AppError` with code, caught by middleware
|
|
129
|
+
**Async**: async/await throughout
|
|
130
|
+
|
|
131
|
+
## Unknown / Needs Investigation
|
|
132
|
+
- [Things you could not determine from reading the code]
|
|
133
|
+
```
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: confidence-aware-planning
|
|
3
|
+
description: Plan differently when the agent has low certainty — ask for clarification or narrow scope instead of pretending full understanding.
|
|
4
|
+
origin: FlowDeck
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Confidence-Aware Planning
|
|
8
|
+
|
|
9
|
+
Not every task comes with complete information. This skill enforces honest uncertainty signaling and adaptive planning when confidence is low.
|
|
10
|
+
|
|
11
|
+
## Confidence Levels
|
|
12
|
+
|
|
13
|
+
| Level | Meaning | Action |
|
|
14
|
+
|-------|---------|--------|
|
|
15
|
+
| HIGH (≥80%) | Well-understood scope, clear precedent in codebase | Proceed to plan normally |
|
|
16
|
+
| MEDIUM (40–79%) | Partial understanding, some unknowns | Surface assumptions, narrow scope, flag for review |
|
|
17
|
+
| LOW (<40%) | Significant unknowns, no clear precedent | Ask clarifying questions first, do not plan until answered |
|
|
18
|
+
|
|
19
|
+
## Signals That Lower Confidence
|
|
20
|
+
|
|
21
|
+
- Codebase section not covered in `.codebase/ARCHITECTURE.md`
|
|
22
|
+
- No prior DISCUSS.md for this feature area
|
|
23
|
+
- Request touches 5+ files with unclear dependencies
|
|
24
|
+
- Request uses domain jargon that doesn't appear in codebase
|
|
25
|
+
- No test coverage in the affected area (no test files found)
|
|
26
|
+
- File is in a volatile or critical zone per `.codebase/VOLATILITY.json`
|
|
27
|
+
|
|
28
|
+
## Workflow
|
|
29
|
+
|
|
30
|
+
Before planning ANY task:
|
|
31
|
+
|
|
32
|
+
1. Read relevant codebase docs (ARCHITECTURE.md, STACK.md, CONVENTIONS.md)
|
|
33
|
+
2. Scan affected files for context
|
|
34
|
+
3. Estimate confidence level
|
|
35
|
+
4. Act based on level:
|
|
36
|
+
- HIGH: proceed to `/plan`
|
|
37
|
+
- MEDIUM: write explicit assumptions at the top of PLAN.md, flag 3 highest risks
|
|
38
|
+
- LOW: stop, ask clarifying questions, do not write PLAN.md until answered
|
|
39
|
+
|
|
40
|
+
## Clarifying Question Format
|
|
41
|
+
|
|
42
|
+
When confidence is LOW, ask in this format:
|
|
43
|
+
```
|
|
44
|
+
Before I can plan this, I need to understand:
|
|
45
|
+
|
|
46
|
+
1. [Question about scope/behavior]
|
|
47
|
+
2. [Question about constraint or requirement]
|
|
48
|
+
3. [Question about existing system behavior]
|
|
49
|
+
|
|
50
|
+
I have LOW confidence because: [specific reason]
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Assumption Declaration Format
|
|
54
|
+
|
|
55
|
+
When confidence is MEDIUM, include at the top of every plan:
|
|
56
|
+
```markdown
|
|
57
|
+
## Assumptions (MEDIUM confidence)
|
|
58
|
+
- A1: [assumption] — if wrong, [consequence]
|
|
59
|
+
- A2: [assumption] — if wrong, [consequence]
|
|
60
|
+
|
|
61
|
+
## Risks
|
|
62
|
+
1. [risk]: [mitigation]
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Non-negotiable
|
|
66
|
+
|
|
67
|
+
Never write a plan that pretends HIGH confidence when the agent actually has LOW confidence. False certainty leads to wrong implementations and wasted effort.
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: context-load
|
|
3
|
+
description: Load full project context at session start. Read STATE.md, PLAN.md, PROJECT.md, CONVENTIONS.md, and ARCHITECTURE.md to brief any agent on where work stands.
|
|
4
|
+
origin: FlowDeck
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Context Load Skill
|
|
8
|
+
|
|
9
|
+
Gets any agent up to speed in under 30 seconds. Loads the minimum set of project files needed to understand what phase the work is in and what comes next.
|
|
10
|
+
|
|
11
|
+
## When to Activate
|
|
12
|
+
|
|
13
|
+
Activate at the start of every session, or when:
|
|
14
|
+
- Starting a new OpenCode session
|
|
15
|
+
- An agent seems unaware of the current project state
|
|
16
|
+
- You want to brief a new agent on the project
|
|
17
|
+
|
|
18
|
+
## Core Principles
|
|
19
|
+
|
|
20
|
+
- Load context before asking any agent to do work
|
|
21
|
+
- Read in dependency order: state first, then plan, then code conventions
|
|
22
|
+
- Surface blockers immediately — don't proceed if STATE.md shows a blocker
|
|
23
|
+
|
|
24
|
+
## Workflow
|
|
25
|
+
|
|
26
|
+
1. **Read STATE.md** — current phase, active plan, completed steps, blockers
|
|
27
|
+
2. **Read active PLAN.md** — (path from STATE.md) next tasks and success criteria
|
|
28
|
+
3. **Read .planning/PROJECT.md** — project name, stack, constraints
|
|
29
|
+
4. **Read .codebase/CONVENTIONS.md** — naming patterns, import style, error handling
|
|
30
|
+
5. **Read .codebase/ARCHITECTURE.md** — component layout and data flow
|
|
31
|
+
|
|
32
|
+
## Context Files
|
|
33
|
+
|
|
34
|
+
| File | Contains | Load Order |
|
|
35
|
+
|------|---------|-----------|
|
|
36
|
+
| `STATE.md` | Current phase, active plan, completed steps | 1st |
|
|
37
|
+
| `.planning/phases/phase-N/PLAN.md` | Tasks, success criteria | 2nd |
|
|
38
|
+
| `.planning/PROJECT.md` | Project context, constraints | 3rd |
|
|
39
|
+
| `.codebase/CONVENTIONS.md` | Naming, imports, patterns | 4th |
|
|
40
|
+
| `.codebase/ARCHITECTURE.md` | System design, components | 5th |
|
|
41
|
+
|
|
42
|
+
## Output Format
|
|
43
|
+
|
|
44
|
+
After loading context, produce this briefing:
|
|
45
|
+
|
|
46
|
+
```markdown
|
|
47
|
+
## Project Context Loaded
|
|
48
|
+
|
|
49
|
+
**Project**: [name from PROJECT.md]
|
|
50
|
+
**Phase**: [N] — [phase name]
|
|
51
|
+
**Status**: [discuss | plan | execute | review]
|
|
52
|
+
**Active Plan**: [path to PLAN.md]
|
|
53
|
+
|
|
54
|
+
**Completed Steps**: [N of M]
|
|
55
|
+
**Next Step**: [next incomplete step from PLAN.md]
|
|
56
|
+
|
|
57
|
+
**Blockers**: [none | description]
|
|
58
|
+
|
|
59
|
+
**Stack**: [from PROJECT.md or CONVENTIONS.md]
|
|
60
|
+
**Key Conventions**: [2-3 most important patterns]
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
If any file is missing, note it: "STATE.md not found — run `/new-project` to initialize."
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: debug-flow
|
|
3
|
+
description: Systematic debugging workflow. Reproduce the issue, isolate root cause, write a failing test, fix, verify. Use when diagnosing bugs or unexpected behavior.
|
|
4
|
+
origin: FlowDeck
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Debug Flow Skill
|
|
8
|
+
|
|
9
|
+
Finds root causes through systematic investigation. Does not guess. Does not fix symptoms.
|
|
10
|
+
|
|
11
|
+
## When to Activate
|
|
12
|
+
|
|
13
|
+
Activate when:
|
|
14
|
+
- A bug has been reported
|
|
15
|
+
- Code is producing unexpected output
|
|
16
|
+
- Tests are failing intermittently
|
|
17
|
+
- An error is occurring in production
|
|
18
|
+
|
|
19
|
+
## Core Principles
|
|
20
|
+
|
|
21
|
+
- Read stack traces completely — never skip to the middle
|
|
22
|
+
- Fix root causes, not symptoms
|
|
23
|
+
- Check recent changes first — `git log --oneline -20`
|
|
24
|
+
- Reproduce before fixing — if you can't reproduce it, you don't understand it
|
|
25
|
+
|
|
26
|
+
## Workflow
|
|
27
|
+
|
|
28
|
+
1. **Reproduce** — confirm you can make the bug happen reliably
|
|
29
|
+
2. **Read the full stack trace** — start from the top (error), trace to the origin
|
|
30
|
+
3. **Check recent changes** — `git log --oneline -20` to find what changed
|
|
31
|
+
4. **Trace execution backward** — what called the failing function? What state did it receive?
|
|
32
|
+
5. **Identify root cause** — the earliest point where invariants are violated
|
|
33
|
+
6. **Write a failing test** — one test that fails with the bug present
|
|
34
|
+
7. **Fix** — change the minimum code to make the test pass
|
|
35
|
+
8. **Verify** — run the full test suite
|
|
36
|
+
|
|
37
|
+
## Common Root Causes
|
|
38
|
+
|
|
39
|
+
| Symptom | Likely Cause | Investigation |
|
|
40
|
+
|---------|-------------|---------------|
|
|
41
|
+
| `Cannot read property of undefined` | Missing null check upstream | Trace where undefined enters |
|
|
42
|
+
| Wrong calculation result | Type coercion (`"5" + 3 = "53"`) | Check input types |
|
|
43
|
+
| Race condition / intermittent | Missing `await` | Find async functions called without await |
|
|
44
|
+
| Auth bypass | Missing middleware | Check route definition vs working routes |
|
|
45
|
+
| Infinite loop | Wrong termination condition | Log loop counter, check exit logic |
|
|
46
|
+
| Memory leak | Event listener not cleaned up | Check `useEffect` returns, `removeListener` calls |
|
|
47
|
+
| Promise rejection unhandled | Missing `.catch()` or `try/catch` | Check all async call sites |
|
|
48
|
+
| Type error at runtime | `as any` hiding real type | Find where the cast was added |
|
|
49
|
+
| Stale data in UI | Cache not invalidated | Check cache keys and invalidation logic |
|
|
50
|
+
| Import error | Circular dependency or missing export | `npx madge --circular src/` |
|
|
51
|
+
|
|
52
|
+
## Bisect for Regressions
|
|
53
|
+
|
|
54
|
+
When something worked before but is broken now:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
git bisect start
|
|
58
|
+
git bisect bad # current is broken
|
|
59
|
+
git bisect good [last-good-sha] # last known working commit
|
|
60
|
+
npm test # run after each checkout
|
|
61
|
+
git bisect good # or: git bisect bad
|
|
62
|
+
git bisect reset # when done
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Output Format
|
|
66
|
+
|
|
67
|
+
```markdown
|
|
68
|
+
## Debug Report
|
|
69
|
+
|
|
70
|
+
**Root Cause**: [one sentence]
|
|
71
|
+
**Evidence**: `path/to/file.ts:42` — [what the code does wrong]
|
|
72
|
+
**Call Path**: request → controller → service → ❌ null dereference at line 42
|
|
73
|
+
**Fix**: [specific change to make]
|
|
74
|
+
**Test**: [name of the failing test that reproduces the bug]
|
|
75
|
+
```
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: decision-trace
|
|
3
|
+
description: Record why the agent changed something, what evidence was used, and what assumptions were made — so code reviews become much faster.
|
|
4
|
+
origin: FlowDeck
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Decision Trace
|
|
8
|
+
|
|
9
|
+
Every non-trivial edit should be recorded in `.codebase/DECISIONS.jsonl`. This creates an append-only audit trail that makes code review and debugging faster.
|
|
10
|
+
|
|
11
|
+
## When to Record a Decision
|
|
12
|
+
|
|
13
|
+
Record when:
|
|
14
|
+
- Editing a file that affects behavior (not just formatting/comments)
|
|
15
|
+
- Choosing between two or more implementation approaches
|
|
16
|
+
- Making an assumption about a requirement
|
|
17
|
+
- Fixing a bug or regression
|
|
18
|
+
- Changing an API contract or schema
|
|
19
|
+
|
|
20
|
+
## How to Record
|
|
21
|
+
|
|
22
|
+
Use the `decision-trace` tool:
|
|
23
|
+
|
|
24
|
+
```json
|
|
25
|
+
{
|
|
26
|
+
"action": "record",
|
|
27
|
+
"entry": {
|
|
28
|
+
"id": "auth-refactor-2024-05-01",
|
|
29
|
+
"file_path": "src/services/auth.ts",
|
|
30
|
+
"change_type": "edit",
|
|
31
|
+
"rationale": "Refactored token validation to use constant-time comparison to prevent timing attacks",
|
|
32
|
+
"evidence": [
|
|
33
|
+
"OWASP: timing attacks on string comparison",
|
|
34
|
+
"Prior failure: auth-timing-2024-03 in FAILURES.json"
|
|
35
|
+
],
|
|
36
|
+
"assumptions": [
|
|
37
|
+
"Token format remains base64-encoded JWT",
|
|
38
|
+
"Redis cache is available for token blacklist"
|
|
39
|
+
],
|
|
40
|
+
"alternatives_considered": [
|
|
41
|
+
"Keep string comparison (rejected: timing attack risk)",
|
|
42
|
+
"Move validation to edge (rejected: adds latency)"
|
|
43
|
+
],
|
|
44
|
+
"risk_level": "medium",
|
|
45
|
+
"agent": "coder"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Automatic Recording
|
|
51
|
+
|
|
52
|
+
The `decision-trace-hook` auto-records a minimal entry for every write/edit. The full entry (with rationale, evidence, assumptions) should be added by the agent explicitly using the tool above.
|
|
53
|
+
|
|
54
|
+
## Querying Decisions
|
|
55
|
+
|
|
56
|
+
```json
|
|
57
|
+
// Get all decisions for a file
|
|
58
|
+
{ "action": "get_for_file", "file_path": "src/services/auth.ts" }
|
|
59
|
+
|
|
60
|
+
// Get all high-risk decisions
|
|
61
|
+
{ "action": "query", "query": { "risk_level": "high", "limit": 10 } }
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Review Acceleration
|
|
65
|
+
|
|
66
|
+
When reviewing a PR, query DECISIONS.jsonl for all files in the diff. For each entry, reviewers can quickly see the "why" without asking the author.
|
|
67
|
+
|
|
68
|
+
## Guidance
|
|
69
|
+
|
|
70
|
+
- Rationale should answer: "why this approach and not the obvious alternative?"
|
|
71
|
+
- Evidence should be checkable: a doc URL, a failure ID, a test result
|
|
72
|
+
- Assumptions should be explicit: if an assumption breaks, so does the change
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dependency-audit
|
|
3
|
+
description: Audits npm/pip/cargo dependencies for known vulnerabilities, outdated packages, and license issues. Activate before releases or when CVE alerts are received.
|
|
4
|
+
origin: FlowDeck
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Dependency Audit Skill
|
|
8
|
+
|
|
9
|
+
Checks dependencies for security vulnerabilities, outdated versions, and license issues before they cause problems in production.
|
|
10
|
+
|
|
11
|
+
## When to Activate
|
|
12
|
+
|
|
13
|
+
Activate when:
|
|
14
|
+
- Preparing a production release
|
|
15
|
+
- Receiving a CVE alert for a dependency
|
|
16
|
+
- Adding a major new dependency
|
|
17
|
+
- It has been more than 30 days since last audit
|
|
18
|
+
|
|
19
|
+
## Core Principles
|
|
20
|
+
|
|
21
|
+
- **Security over convenience** — patch vulnerabilities before releasing
|
|
22
|
+
- **Patch before releasing** — critical and high findings block deployment
|
|
23
|
+
- **License compliance matters** — GPL in a commercial product can create legal problems
|
|
24
|
+
|
|
25
|
+
## Workflow
|
|
26
|
+
|
|
27
|
+
1. Run security audit commands
|
|
28
|
+
2. Triage findings by severity
|
|
29
|
+
3. Check for outdated packages
|
|
30
|
+
4. Check licenses of key dependencies
|
|
31
|
+
5. Produce report with recommended actions
|
|
32
|
+
|
|
33
|
+
## Audit Commands
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
# npm
|
|
37
|
+
npm audit # all vulnerabilities
|
|
38
|
+
npm audit --audit-level=moderate # moderate and above
|
|
39
|
+
npm audit fix # auto-fix safe upgrades
|
|
40
|
+
npm audit fix --force # force fix (may break things — test first)
|
|
41
|
+
|
|
42
|
+
# Check outdated packages
|
|
43
|
+
npm outdated
|
|
44
|
+
|
|
45
|
+
# Snyk (more comprehensive)
|
|
46
|
+
npx snyk test
|
|
47
|
+
npx snyk monitor
|
|
48
|
+
|
|
49
|
+
# Python
|
|
50
|
+
pip-audit # install: pip install pip-audit
|
|
51
|
+
pip list --outdated
|
|
52
|
+
|
|
53
|
+
# Rust
|
|
54
|
+
cargo audit # install: cargo install cargo-audit
|
|
55
|
+
|
|
56
|
+
# Check licenses
|
|
57
|
+
npx license-checker --summary
|
|
58
|
+
npx license-checker --onlyAllow 'MIT;Apache-2.0;BSD-2-Clause;BSD-3-Clause;ISC'
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Severity Triage
|
|
62
|
+
|
|
63
|
+
| Severity | Action | Timeline |
|
|
64
|
+
|----------|--------|---------|
|
|
65
|
+
| Critical | Fix immediately — do not deploy | Before next commit |
|
|
66
|
+
| High | Fix before release | Before next deployment |
|
|
67
|
+
| Moderate | Fix in next sprint | Within 2 weeks |
|
|
68
|
+
| Low | Track and fix eventually | Next maintenance window |
|
|
69
|
+
|
|
70
|
+
## Common Vulnerability Patterns
|
|
71
|
+
|
|
72
|
+
- **Prototype pollution** — lodash <4.17.21, merge-deep <3.0.3
|
|
73
|
+
- **Path traversal** — file utility packages that accept user-controlled paths
|
|
74
|
+
- **ReDoS** — regex-based parsers (moment.js, validator.js older versions)
|
|
75
|
+
- **Command injection** — packages that shell out with user-controlled input
|
|
76
|
+
|
|
77
|
+
## Update Strategy
|
|
78
|
+
|
|
79
|
+
| Change Type | Safety | Action |
|
|
80
|
+
|-------------|--------|--------|
|
|
81
|
+
| Patch (x.y.Z) | Very safe | Update immediately |
|
|
82
|
+
| Minor (x.Y.z) | Safe with tests | Update, run full test suite |
|
|
83
|
+
| Major (X.y.z) | Breaking changes likely | Read changelog, test thoroughly |
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
# Safe patch/minor updates
|
|
87
|
+
npm update # updates within version constraints
|
|
88
|
+
npx npm-check-updates -u --target patch # update only patches
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## License Audit
|
|
92
|
+
|
|
93
|
+
| License | Commercial Use | Notes |
|
|
94
|
+
|---------|---------------|-------|
|
|
95
|
+
| MIT | ✅ Safe | Most permissive |
|
|
96
|
+
| Apache 2.0 | ✅ Safe | Patent grant included |
|
|
97
|
+
| BSD-2/3 | ✅ Safe | Attribution required |
|
|
98
|
+
| ISC | ✅ Safe | MIT equivalent |
|
|
99
|
+
| LGPL | ⚠️ Check | OK if only linking to it |
|
|
100
|
+
| GPL | ❌ Risky | Legal review required for commercial |
|
|
101
|
+
| AGPL | ❌ Risky | Strongest copyleft — legal review required |
|
|
102
|
+
| Unknown | ❌ Investigate | Do not ship until license is known |
|
|
103
|
+
|
|
104
|
+
## Output Format
|
|
105
|
+
|
|
106
|
+
```markdown
|
|
107
|
+
## Dependency Audit Report
|
|
108
|
+
|
|
109
|
+
### Vulnerabilities
|
|
110
|
+
| Package | Severity | CVE | Fix |
|
|
111
|
+
|---------|----------|-----|-----|
|
|
112
|
+
| lodash@4.17.19 | High | CVE-2021-23337 | Upgrade to 4.17.21 |
|
|
113
|
+
|
|
114
|
+
### Outdated Packages (Major Versions)
|
|
115
|
+
| Package | Current | Latest | Breaking Changes |
|
|
116
|
+
|---------|---------|--------|-----------------|
|
|
117
|
+
| express | 4.17.3 | 5.0.0 | Yes — read changelog |
|
|
118
|
+
|
|
119
|
+
### License Issues
|
|
120
|
+
| Package | License | Issue |
|
|
121
|
+
|---------|---------|-------|
|
|
122
|
+
| some-pkg | GPL-3.0 | Requires legal review for commercial use |
|
|
123
|
+
|
|
124
|
+
### Verdict: PASS ✅ | FAIL ❌
|
|
125
|
+
FAIL if any Critical or High vulnerabilities remain unfixed.
|
|
126
|
+
```
|