agentic-forge 0.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.
- package/.gitattributes +24 -0
- package/.github/workflows/ci.yml +70 -0
- package/.markdownlint-cli2.jsonc +16 -0
- package/.prettierignore +3 -0
- package/.prettierrc +6 -0
- package/.vscode/agentic-forge.code-workspace +26 -0
- package/CHANGELOG.md +100 -0
- package/CLAUDE.md +158 -0
- package/CONTRIBUTING.md +152 -0
- package/LICENSE +21 -0
- package/README.md +145 -0
- package/agentic-forge-banner.png +0 -0
- package/biome.json +21 -0
- package/package.json +5 -0
- package/scripts/copy-assets.js +21 -0
- package/src/agents/explorer.md +97 -0
- package/src/agents/reviewer.md +137 -0
- package/src/checkpoints/manager.ts +119 -0
- package/src/claude/.claude/skills/analyze/SKILL.md +241 -0
- package/src/claude/.claude/skills/analyze/references/bug.md +62 -0
- package/src/claude/.claude/skills/analyze/references/debt.md +76 -0
- package/src/claude/.claude/skills/analyze/references/doc.md +67 -0
- package/src/claude/.claude/skills/analyze/references/security.md +76 -0
- package/src/claude/.claude/skills/analyze/references/style.md +72 -0
- package/src/claude/.claude/skills/create-checkpoint/SKILL.md +88 -0
- package/src/claude/.claude/skills/create-log/SKILL.md +75 -0
- package/src/claude/.claude/skills/fix-analyze/SKILL.md +102 -0
- package/src/claude/.claude/skills/git-branch/SKILL.md +71 -0
- package/src/claude/.claude/skills/git-commit/SKILL.md +107 -0
- package/src/claude/.claude/skills/git-pr/SKILL.md +96 -0
- package/src/claude/.claude/skills/orchestrate/SKILL.md +120 -0
- package/src/claude/.claude/skills/sdlc-plan/SKILL.md +163 -0
- package/src/claude/.claude/skills/sdlc-plan/references/bug.md +115 -0
- package/src/claude/.claude/skills/sdlc-plan/references/chore.md +105 -0
- package/src/claude/.claude/skills/sdlc-plan/references/feature.md +130 -0
- package/src/claude/.claude/skills/sdlc-review/SKILL.md +215 -0
- package/src/claude/.claude/skills/workflow-builder/SKILL.md +185 -0
- package/src/claude/.claude/skills/workflow-builder/references/REFERENCE.md +487 -0
- package/src/claude/.claude/skills/workflow-builder/references/workflow-example.yaml +427 -0
- package/src/cli.ts +182 -0
- package/src/commands/config-cmd.ts +28 -0
- package/src/commands/index.ts +21 -0
- package/src/commands/init.ts +96 -0
- package/src/commands/release-notes.ts +85 -0
- package/src/commands/resume.ts +103 -0
- package/src/commands/run.ts +234 -0
- package/src/commands/shortcuts.ts +11 -0
- package/src/commands/skills-dir.ts +11 -0
- package/src/commands/status.ts +112 -0
- package/src/commands/update.ts +64 -0
- package/src/commands/version.ts +27 -0
- package/src/commands/workflows.ts +129 -0
- package/src/config.ts +129 -0
- package/src/console.ts +790 -0
- package/src/executor.ts +354 -0
- package/src/git/worktree.ts +236 -0
- package/src/logging/logger.ts +95 -0
- package/src/orchestrator.ts +815 -0
- package/src/parser.ts +225 -0
- package/src/progress.ts +306 -0
- package/src/prompts/agentic-system.md +31 -0
- package/src/ralph-loop.ts +260 -0
- package/src/renderer.ts +164 -0
- package/src/runner.ts +634 -0
- package/src/signal-manager.ts +55 -0
- package/src/steps/base.ts +71 -0
- package/src/steps/conditional-step.ts +144 -0
- package/src/steps/index.ts +15 -0
- package/src/steps/parallel-step.ts +213 -0
- package/src/steps/prompt-step.ts +121 -0
- package/src/steps/ralph-loop-step.ts +186 -0
- package/src/steps/serial-step.ts +84 -0
- package/src/templates/analysis/bug.md.j2 +35 -0
- package/src/templates/analysis/debt.md.j2 +38 -0
- package/src/templates/analysis/doc.md.j2 +45 -0
- package/src/templates/analysis/security.md.j2 +35 -0
- package/src/templates/analysis/style.md.j2 +44 -0
- package/src/templates/analysis-summary.md.j2 +58 -0
- package/src/templates/checkpoint.md.j2 +27 -0
- package/src/templates/implementation-report.md.j2 +81 -0
- package/src/templates/memory.md.j2 +16 -0
- package/src/templates/plan-bug.md.j2 +42 -0
- package/src/templates/plan-chore.md.j2 +27 -0
- package/src/templates/plan-feature.md.j2 +41 -0
- package/src/templates/progress.json.j2 +16 -0
- package/src/templates/ralph-report.md.j2 +45 -0
- package/src/types.ts +141 -0
- package/src/workflows/analyze-codebase-merge.yaml +328 -0
- package/src/workflows/analyze-codebase.yaml +196 -0
- package/src/workflows/analyze-single.yaml +56 -0
- package/src/workflows/demo.yaml +180 -0
- package/src/workflows/one-shot.yaml +54 -0
- package/src/workflows/plan-build-review.yaml +160 -0
- package/src/workflows/ralph-loop.yaml +73 -0
- package/tests/config.test.ts +219 -0
- package/tests/console.test.ts +506 -0
- package/tests/executor.test.ts +339 -0
- package/tests/init.test.ts +86 -0
- package/tests/logger.test.ts +110 -0
- package/tests/parser.test.ts +290 -0
- package/tests/progress.test.ts +345 -0
- package/tests/ralph-loop.test.ts +418 -0
- package/tests/renderer.test.ts +350 -0
- package/tests/runner.test.ts +497 -0
- package/tests/setup.test.ts +7 -0
- package/tests/signal-manager.test.ts +26 -0
- package/tests/steps.test.ts +412 -0
- package/tests/worktree.test.ts +411 -0
- package/tsconfig.json +18 -0
- package/vitest.config.ts +8 -0
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: af-analyze
|
|
3
|
+
description: Analyze codebase for bugs, debt, documentation, security, or style issues
|
|
4
|
+
argument-hint: <type> [paths...]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Analyze Codebase
|
|
8
|
+
|
|
9
|
+
## Overview
|
|
10
|
+
|
|
11
|
+
Analyze codebase for issues across multiple domains: bugs, technical debt, documentation, security vulnerabilities, or style inconsistencies. Categorizes findings by severity with specific file locations and actionable fix suggestions. Returns structured JSON for workflow integration and generates a markdown report.
|
|
12
|
+
|
|
13
|
+
## Arguments
|
|
14
|
+
|
|
15
|
+
### Definitions
|
|
16
|
+
|
|
17
|
+
- **`<type>`** (required): Analysis type to perform. Must be one of:
|
|
18
|
+
- `bug` - Logic errors, runtime errors, and edge cases
|
|
19
|
+
- `debt` - Technical debt, architecture, and performance issues
|
|
20
|
+
- `doc` - Documentation accuracy and completeness
|
|
21
|
+
- `security` - Vulnerabilities, unsafe patterns, and dependency issues
|
|
22
|
+
- `style` - Code style, consistency, and best practices
|
|
23
|
+
- **`[paths...]`** (optional): Space-separated list of files or directories to analyze. When provided, only these paths are analyzed. Otherwise, the entire codebase is analyzed.
|
|
24
|
+
|
|
25
|
+
### Values
|
|
26
|
+
|
|
27
|
+
\$ARGUMENTS
|
|
28
|
+
|
|
29
|
+
## Additional Resources
|
|
30
|
+
|
|
31
|
+
Load ONE of these based on the `<type>` argument:
|
|
32
|
+
|
|
33
|
+
- For bug analysis, see [references/bug.md](references/bug.md)
|
|
34
|
+
- For debt analysis, see [references/debt.md](references/debt.md)
|
|
35
|
+
- For doc analysis, see [references/doc.md](references/doc.md)
|
|
36
|
+
- For security analysis, see [references/security.md](references/security.md)
|
|
37
|
+
- For style analysis, see [references/style.md](references/style.md)
|
|
38
|
+
|
|
39
|
+
## Core Principles
|
|
40
|
+
|
|
41
|
+
- Only report REAL issues - quality over quantity
|
|
42
|
+
- Only report UNFIXED issues - if resolved, do not include it
|
|
43
|
+
- Be specific with exact file and line numbers
|
|
44
|
+
- Understand project patterns before flagging issues
|
|
45
|
+
- Consider framework conventions and intentional design choices
|
|
46
|
+
- Check if apparent issues are handled elsewhere before flagging
|
|
47
|
+
- Recognize test-specific patterns and legitimate edge cases
|
|
48
|
+
- If no issues found, return success with zero counts
|
|
49
|
+
|
|
50
|
+
## Instructions
|
|
51
|
+
|
|
52
|
+
1. **Validate Type Argument**
|
|
53
|
+
- Check that `<type>` argument is provided
|
|
54
|
+
- Verify it is one of: `bug`, `debt`, `doc`, `security`, `style`
|
|
55
|
+
- If missing or invalid, stop execution and return error:
|
|
56
|
+
|
|
57
|
+
```json
|
|
58
|
+
{
|
|
59
|
+
"success": false,
|
|
60
|
+
"error": "Invalid or missing type argument. Must be one of: bug, debt, doc, security, style"
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
2. **Load Type-Specific Guidelines**
|
|
65
|
+
Based on the `<type>` argument, load the corresponding reference file:
|
|
66
|
+
- `bug` -> Read [references/bug.md](references/bug.md)
|
|
67
|
+
- `debt` -> Read [references/debt.md](references/debt.md)
|
|
68
|
+
- `doc` -> Read [references/doc.md](references/doc.md)
|
|
69
|
+
- `security` -> Read [references/security.md](references/security.md)
|
|
70
|
+
- `style` -> Read [references/style.md](references/style.md)
|
|
71
|
+
|
|
72
|
+
3. **Determine Scope**
|
|
73
|
+
- If `[paths]` are provided, focus only on those files/directories
|
|
74
|
+
- Otherwise, analyze the entire codebase
|
|
75
|
+
- Exclude test files, node_modules, build outputs, and vendor directories
|
|
76
|
+
- For `doc` type: find all documentation files (README, docs/, \*.md)
|
|
77
|
+
|
|
78
|
+
4. **Understand Project Context**
|
|
79
|
+
- Check for linter configs (ESLint, Prettier, Ruff)
|
|
80
|
+
- Read CLAUDE.md for project-specific guidelines
|
|
81
|
+
- Analyze existing code patterns to understand conventions
|
|
82
|
+
|
|
83
|
+
5. **Analyze for Issues**
|
|
84
|
+
- Apply type-specific analysis criteria from the loaded reference file
|
|
85
|
+
- Verify each finding is a real issue, not a false positive
|
|
86
|
+
- Check if apparent issues are handled elsewhere
|
|
87
|
+
|
|
88
|
+
6. **Categorize Findings**
|
|
89
|
+
Rate each finding by severity (all types use this scale):
|
|
90
|
+
- **Critical**: Severe impact - crashes, data loss, security breaches, misleading docs
|
|
91
|
+
- **High**: Significant impact - functional bugs, major gaps, exploitable with conditions
|
|
92
|
+
- **Medium**: Moderate impact - edge cases, minor issues, incomplete coverage
|
|
93
|
+
- **Low**: Minimal impact - best practice violations, minor improvements
|
|
94
|
+
|
|
95
|
+
7. **Generate Report**
|
|
96
|
+
- Save to `agentic/analysis/<type>.md`
|
|
97
|
+
- Include date in report header
|
|
98
|
+
- Group findings by severity
|
|
99
|
+
|
|
100
|
+
8. **Return JSON Output**
|
|
101
|
+
- Return structured JSON matching the output schema
|
|
102
|
+
- Use the unified finding schema for all types
|
|
103
|
+
- Include notes only when meaningful (see type-specific reference for guidance)
|
|
104
|
+
|
|
105
|
+
## Output Guidance
|
|
106
|
+
|
|
107
|
+
Return a JSON object AND save a detailed markdown report.
|
|
108
|
+
|
|
109
|
+
### JSON Output Schema
|
|
110
|
+
|
|
111
|
+
```json
|
|
112
|
+
{
|
|
113
|
+
"success": true,
|
|
114
|
+
"analysis_type": "{{type}}",
|
|
115
|
+
"findings_count": {
|
|
116
|
+
"critical": "{{critical_count}}",
|
|
117
|
+
"high": "{{high_count}}",
|
|
118
|
+
"medium": "{{medium_count}}",
|
|
119
|
+
"low": "{{low_count}}",
|
|
120
|
+
"total": "{{total_count}}"
|
|
121
|
+
},
|
|
122
|
+
"findings": ["{{findings_array}}"],
|
|
123
|
+
"document_path": "agentic/analysis/{{type}}.md"
|
|
124
|
+
}
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
<!--
|
|
128
|
+
Placeholders:
|
|
129
|
+
- {{type}}: Analysis type (bug, debt, doc, security, style)
|
|
130
|
+
- {{critical_count}}, {{high_count}}, {{medium_count}}, {{low_count}}: Integer counts per severity
|
|
131
|
+
- {{total_count}}: Sum of all findings
|
|
132
|
+
- {{findings_array}}: Array of finding objects using the Finding Schema below
|
|
133
|
+
-->
|
|
134
|
+
|
|
135
|
+
### Finding Schema
|
|
136
|
+
|
|
137
|
+
All analysis types use this unified finding structure:
|
|
138
|
+
|
|
139
|
+
```json
|
|
140
|
+
{
|
|
141
|
+
"id": "{{id_prefix}}-{{sequence}}",
|
|
142
|
+
"severity": "{{severity}}",
|
|
143
|
+
"title": "{{title}}",
|
|
144
|
+
"file": "{{file}}",
|
|
145
|
+
"line": "{{line}}",
|
|
146
|
+
"description": "{{description}}",
|
|
147
|
+
"fix": "{{fix}}",
|
|
148
|
+
"notes": "{{notes}}"
|
|
149
|
+
}
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
<!--
|
|
153
|
+
Placeholders:
|
|
154
|
+
- {{id_prefix}}: Type-based prefix (BUG, DEBT, DOC, SEC, STYLE)
|
|
155
|
+
- {{sequence}}: Sequential number starting at 001
|
|
156
|
+
- {{severity}}: One of critical, high, medium, low
|
|
157
|
+
- {{title}}: Brief descriptive title of the issue
|
|
158
|
+
- {{file}}: Path to the affected file
|
|
159
|
+
- {{line}}: Line number where issue occurs
|
|
160
|
+
- {{description}}: What is wrong and why it's a problem
|
|
161
|
+
- {{fix}}: How to fix the issue
|
|
162
|
+
- {{notes}}: Optional additional context (omit key if empty)
|
|
163
|
+
|
|
164
|
+
ID Prefixes by type:
|
|
165
|
+
- bug -> BUG-001, BUG-002, ...
|
|
166
|
+
- debt -> DEBT-001, DEBT-002, ...
|
|
167
|
+
- doc -> DOC-001, DOC-002, ...
|
|
168
|
+
- security -> SEC-001, SEC-002, ...
|
|
169
|
+
- style -> STYLE-001, STYLE-002, ...
|
|
170
|
+
|
|
171
|
+
Notes field: Optional. Only include when there is meaningful additional context.
|
|
172
|
+
See the type-specific reference file for guidance on what to include.
|
|
173
|
+
-->
|
|
174
|
+
|
|
175
|
+
## Templates
|
|
176
|
+
|
|
177
|
+
### Markdown Report Template
|
|
178
|
+
|
|
179
|
+
Save to `agentic/analysis/<type>.md`:
|
|
180
|
+
|
|
181
|
+
```markdown
|
|
182
|
+
# {{type_title}} Analysis Report
|
|
183
|
+
|
|
184
|
+
**Date**: {{date}}
|
|
185
|
+
**Scope**: {{scope}}
|
|
186
|
+
|
|
187
|
+
## Summary
|
|
188
|
+
|
|
189
|
+
| Severity | Count |
|
|
190
|
+
| -------- | ------------------ |
|
|
191
|
+
| Critical | {{critical_count}} |
|
|
192
|
+
| High | {{high_count}} |
|
|
193
|
+
| Medium | {{medium_count}} |
|
|
194
|
+
| Low | {{low_count}} |
|
|
195
|
+
|
|
196
|
+
## Critical
|
|
197
|
+
|
|
198
|
+
### {{id}}: {{title}}
|
|
199
|
+
|
|
200
|
+
**File:** {{file}}
|
|
201
|
+
**Line:** {{line}}
|
|
202
|
+
**Description:** {{description}}
|
|
203
|
+
**Fix:** {{fix}}
|
|
204
|
+
**Notes:** {{notes}}
|
|
205
|
+
|
|
206
|
+
---
|
|
207
|
+
|
|
208
|
+
## High
|
|
209
|
+
|
|
210
|
+
[Repeat finding format for each high severity issue]
|
|
211
|
+
|
|
212
|
+
## Medium
|
|
213
|
+
|
|
214
|
+
[Repeat finding format for each medium severity issue]
|
|
215
|
+
|
|
216
|
+
## Low
|
|
217
|
+
|
|
218
|
+
[Repeat finding format for each low severity issue]
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
<!--
|
|
222
|
+
Placeholders:
|
|
223
|
+
- {{type}}: Analysis type in lowercase (bug, debt, doc, security, style)
|
|
224
|
+
- {{type_title}}: Analysis type capitalized for title (Bug, Debt, Doc, Security, Style)
|
|
225
|
+
- {{date}}: Current date in YYYY-MM-DD format
|
|
226
|
+
- {{scope}}: "Entire codebase" or comma-separated list of analyzed paths
|
|
227
|
+
- {{critical_count}}, {{high_count}}, {{medium_count}}, {{low_count}}: Integer counts
|
|
228
|
+
- {{id}}: Finding ID with prefix (e.g., BUG-001, SEC-003)
|
|
229
|
+
- {{title}}: Brief descriptive title
|
|
230
|
+
- {{file}}: Path to the affected file
|
|
231
|
+
- {{line}}: Line number where issue occurs
|
|
232
|
+
- {{description}}: What is wrong and why it's a problem
|
|
233
|
+
- {{fix}}: How to fix the issue
|
|
234
|
+
- {{notes}}: Optional additional context (omit line if empty)
|
|
235
|
+
|
|
236
|
+
Structure:
|
|
237
|
+
- Group findings by severity section (Critical, High, Medium, Low)
|
|
238
|
+
- Within each section, list findings in ID order
|
|
239
|
+
- Add horizontal rule (---) between findings
|
|
240
|
+
- Omit empty severity sections
|
|
241
|
+
-->
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Bug Analysis Reference
|
|
2
|
+
|
|
3
|
+
## Analysis Criteria
|
|
4
|
+
|
|
5
|
+
Focus on finding real bugs, not theoretical concerns:
|
|
6
|
+
|
|
7
|
+
**Logic Errors:**
|
|
8
|
+
|
|
9
|
+
- Incorrect conditions, off-by-one errors, wrong operators
|
|
10
|
+
- Inverted boolean logic, missing negations
|
|
11
|
+
- Incorrect loop bounds or termination conditions
|
|
12
|
+
|
|
13
|
+
**Runtime Errors:**
|
|
14
|
+
|
|
15
|
+
- Null/undefined access without guards
|
|
16
|
+
- Type mismatches and coercion issues
|
|
17
|
+
- Uninitialized variables, use before assignment
|
|
18
|
+
- Array index out of bounds
|
|
19
|
+
|
|
20
|
+
**Error Handling:**
|
|
21
|
+
|
|
22
|
+
- Unhandled exceptions, missing catch blocks
|
|
23
|
+
- Silent failures that swallow errors
|
|
24
|
+
- Missing error cases in switch/if chains
|
|
25
|
+
- Promises without rejection handling
|
|
26
|
+
|
|
27
|
+
**Race Conditions:**
|
|
28
|
+
|
|
29
|
+
- Async timing issues, state corruption
|
|
30
|
+
- Shared state modifications without synchronization
|
|
31
|
+
- Deadlocks and livelocks
|
|
32
|
+
- Check-then-act patterns without atomicity
|
|
33
|
+
|
|
34
|
+
**Resource Leaks:**
|
|
35
|
+
|
|
36
|
+
- Unclosed file handles, streams, connections
|
|
37
|
+
- Memory leaks from retained references
|
|
38
|
+
- Connection pool exhaustion
|
|
39
|
+
- Event listener accumulation
|
|
40
|
+
|
|
41
|
+
**Edge Cases:**
|
|
42
|
+
|
|
43
|
+
- Boundary conditions (empty, max, min values)
|
|
44
|
+
- Empty inputs, null collections
|
|
45
|
+
- Overflow/underflow scenarios
|
|
46
|
+
- Unicode and encoding edge cases
|
|
47
|
+
|
|
48
|
+
## Severity Guidelines
|
|
49
|
+
|
|
50
|
+
- **Critical**: Will cause crashes, data loss, or security issues in normal operation
|
|
51
|
+
- **High**: Significant functional bugs affecting users under common conditions
|
|
52
|
+
- **Medium**: Edge case bugs, minor functional issues, rare conditions
|
|
53
|
+
- **Low**: Potential issues, defensive improvements, unlikely scenarios
|
|
54
|
+
|
|
55
|
+
## Notes
|
|
56
|
+
|
|
57
|
+
Include in the `notes` field when relevant:
|
|
58
|
+
|
|
59
|
+
- Steps to reproduce the bug
|
|
60
|
+
- Related code paths that may also be affected
|
|
61
|
+
- Workarounds currently in place
|
|
62
|
+
- Test cases that would catch this bug
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# Debt Analysis Reference
|
|
2
|
+
|
|
3
|
+
## Analysis Criteria
|
|
4
|
+
|
|
5
|
+
Look for technical debt that provides real improvement value. Working code has value - perfect is the enemy of good.
|
|
6
|
+
|
|
7
|
+
### Architecture
|
|
8
|
+
|
|
9
|
+
- Circular dependencies between modules
|
|
10
|
+
- Overly complex module structures
|
|
11
|
+
- Missing abstraction layers where patterns repeat
|
|
12
|
+
- Tight coupling between components that should be independent
|
|
13
|
+
- God objects/classes that do too much
|
|
14
|
+
|
|
15
|
+
### Code Quality
|
|
16
|
+
|
|
17
|
+
- Significant code duplication (not trivial repetition)
|
|
18
|
+
- Complex functions with high cyclomatic complexity
|
|
19
|
+
- Long methods/classes that should be split
|
|
20
|
+
- Poor naming that obscures intent
|
|
21
|
+
- Magic numbers/strings without explanation
|
|
22
|
+
|
|
23
|
+
### Patterns
|
|
24
|
+
|
|
25
|
+
- Outdated patterns (callbacks vs async/await)
|
|
26
|
+
- Inconsistent patterns across the codebase
|
|
27
|
+
- Anti-patterns (singletons abuse, global state, etc.)
|
|
28
|
+
- Framework misuse or fighting the framework
|
|
29
|
+
|
|
30
|
+
### Performance
|
|
31
|
+
|
|
32
|
+
- Obvious performance bottlenecks
|
|
33
|
+
- N+1 query patterns in database access
|
|
34
|
+
- Unnecessary re-renders in UI frameworks
|
|
35
|
+
- Missing caching opportunities for expensive operations
|
|
36
|
+
- Synchronous operations that should be async
|
|
37
|
+
|
|
38
|
+
## Effort Estimation
|
|
39
|
+
|
|
40
|
+
**Low Effort:**
|
|
41
|
+
|
|
42
|
+
- Simple refactoring
|
|
43
|
+
- Renaming for clarity
|
|
44
|
+
- Extracting small functions
|
|
45
|
+
- Adding types/documentation
|
|
46
|
+
|
|
47
|
+
**Medium Effort:**
|
|
48
|
+
|
|
49
|
+
- Extracting modules/classes
|
|
50
|
+
- Refactoring patterns
|
|
51
|
+
- Adding caching
|
|
52
|
+
- Query optimization
|
|
53
|
+
|
|
54
|
+
**High Effort:**
|
|
55
|
+
|
|
56
|
+
- Architectural changes
|
|
57
|
+
- Major refactoring
|
|
58
|
+
- Database schema changes
|
|
59
|
+
- API redesign
|
|
60
|
+
|
|
61
|
+
## Severity Guidelines
|
|
62
|
+
|
|
63
|
+
- **Critical**: Blocking further development or causing cascading issues
|
|
64
|
+
- **High**: Significant maintainability burden, frequently touched code
|
|
65
|
+
- **Medium**: Noticeable friction, moderate impact areas
|
|
66
|
+
- **Low**: Minor improvements, rarely touched code
|
|
67
|
+
|
|
68
|
+
## Notes
|
|
69
|
+
|
|
70
|
+
Include in the `notes` field when relevant:
|
|
71
|
+
|
|
72
|
+
- Category: architecture, code_quality, patterns, or performance
|
|
73
|
+
- Effort estimate: low, medium, or high
|
|
74
|
+
- Benefit of fixing (why it matters)
|
|
75
|
+
- Dependencies on other debt items
|
|
76
|
+
- Suggested refactoring approach
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# Documentation Analysis Reference
|
|
2
|
+
|
|
3
|
+
## Analysis Criteria
|
|
4
|
+
|
|
5
|
+
Check documentation against actual code. Verify claims before marking as incorrect.
|
|
6
|
+
|
|
7
|
+
### Outdated Information
|
|
8
|
+
|
|
9
|
+
- Does not match current code behavior
|
|
10
|
+
- References removed features or APIs
|
|
11
|
+
- Uses deprecated patterns or syntax
|
|
12
|
+
|
|
13
|
+
### Incorrect Content
|
|
14
|
+
|
|
15
|
+
- Factually wrong statements
|
|
16
|
+
- Wrong API signatures or parameters
|
|
17
|
+
- Incorrect behavior descriptions
|
|
18
|
+
- Security-related misinformation
|
|
19
|
+
|
|
20
|
+
### Missing Documentation
|
|
21
|
+
|
|
22
|
+
- Undocumented public APIs
|
|
23
|
+
- Missing feature documentation
|
|
24
|
+
- No setup/installation instructions
|
|
25
|
+
- Missing configuration options
|
|
26
|
+
|
|
27
|
+
### Broken References
|
|
28
|
+
|
|
29
|
+
- Dead links (internal and external)
|
|
30
|
+
- Invalid file paths
|
|
31
|
+
- References to non-existent sections
|
|
32
|
+
|
|
33
|
+
### Inconsistencies
|
|
34
|
+
|
|
35
|
+
- Contradictory information across files
|
|
36
|
+
- Different explanations for same concept
|
|
37
|
+
- Version mismatches
|
|
38
|
+
|
|
39
|
+
### Incomplete Examples
|
|
40
|
+
|
|
41
|
+
- Non-working code samples
|
|
42
|
+
- Examples missing required imports
|
|
43
|
+
- Outdated syntax in examples
|
|
44
|
+
|
|
45
|
+
## Verification Process
|
|
46
|
+
|
|
47
|
+
1. Compare API documentation with actual implementations
|
|
48
|
+
2. Check if documented features exist
|
|
49
|
+
3. Verify code examples compile/run
|
|
50
|
+
4. Ensure types match documented signatures
|
|
51
|
+
5. Consider documentation may be ahead of code (planned features)
|
|
52
|
+
|
|
53
|
+
## Severity Guidelines
|
|
54
|
+
|
|
55
|
+
- **Critical**: Wrong or misleading - will confuse/mislead users, security misinformation
|
|
56
|
+
- **High**: Outdated or incomplete - significant gaps, missing important sections
|
|
57
|
+
- **Medium**: Moderate issues - outdated examples, unclear explanations
|
|
58
|
+
- **Low**: Minor improvements - typos, grammar, organization suggestions
|
|
59
|
+
|
|
60
|
+
## Notes
|
|
61
|
+
|
|
62
|
+
Include in the `notes` field when relevant:
|
|
63
|
+
|
|
64
|
+
- Code reference: the source file that contradicts the documentation
|
|
65
|
+
- Additional files affected by the same issue
|
|
66
|
+
- Whether documentation might be ahead of code (planned feature)
|
|
67
|
+
- Correct information that should replace the incorrect content
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# Security Analysis Reference
|
|
2
|
+
|
|
3
|
+
## Analysis Criteria
|
|
4
|
+
|
|
5
|
+
Check for common security issues. Verify exploitability before reporting critical/high severity. This complements but does not replace SAST tools and security audits.
|
|
6
|
+
|
|
7
|
+
### Injection
|
|
8
|
+
|
|
9
|
+
- **SQL Injection**: Unsanitized input in SQL queries
|
|
10
|
+
- **Command Injection**: User input passed to shell commands
|
|
11
|
+
- **XSS**: Unescaped output in HTML/JavaScript contexts
|
|
12
|
+
- **Template Injection**: User input in template engines
|
|
13
|
+
- **Path Traversal**: Unsanitized file paths
|
|
14
|
+
|
|
15
|
+
### Authentication/Authorization
|
|
16
|
+
|
|
17
|
+
- Hardcoded credentials in source code
|
|
18
|
+
- Weak authentication mechanisms
|
|
19
|
+
- Missing authorization checks on endpoints
|
|
20
|
+
- Session management issues (fixation, hijacking)
|
|
21
|
+
- Insecure token storage (localStorage for sensitive data)
|
|
22
|
+
- Missing CSRF protection
|
|
23
|
+
|
|
24
|
+
### Data Exposure
|
|
25
|
+
|
|
26
|
+
- Sensitive data in logs (passwords, tokens, PII)
|
|
27
|
+
- Secrets in code or config files
|
|
28
|
+
- Insecure data transmission (HTTP for sensitive data)
|
|
29
|
+
- Verbose error messages revealing internals
|
|
30
|
+
- Debug endpoints exposed in production
|
|
31
|
+
|
|
32
|
+
### Dependencies
|
|
33
|
+
|
|
34
|
+
- Known vulnerable packages (check CVE databases)
|
|
35
|
+
- Outdated dependencies with security fixes
|
|
36
|
+
- Unused but risky dependencies
|
|
37
|
+
|
|
38
|
+
### Configuration
|
|
39
|
+
|
|
40
|
+
- Debug mode enabled in production
|
|
41
|
+
- Insecure defaults (weak passwords, open permissions)
|
|
42
|
+
- Missing security headers (CSP, HSTS, X-Frame-Options)
|
|
43
|
+
- CORS misconfigurations (overly permissive origins)
|
|
44
|
+
- Exposed admin interfaces
|
|
45
|
+
|
|
46
|
+
## OWASP Top 10 Reference
|
|
47
|
+
|
|
48
|
+
| Category | What to Check |
|
|
49
|
+
| ---------------------------------- | ------------------------------------------------ |
|
|
50
|
+
| A01:2021 Broken Access Control | Missing auth checks, IDOR, path traversal |
|
|
51
|
+
| A02:2021 Cryptographic Failures | Weak crypto, hardcoded secrets, insecure storage |
|
|
52
|
+
| A03:2021 Injection | SQL, command, XSS, template injection |
|
|
53
|
+
| A04:2021 Insecure Design | Logic flaws, missing security requirements |
|
|
54
|
+
| A05:2021 Security Misconfiguration | Debug mode, default creds, exposed configs |
|
|
55
|
+
| A06:2021 Vulnerable Components | Outdated deps, known CVEs |
|
|
56
|
+
| A07:2021 Auth Failures | Weak auth, session issues, credential stuffing |
|
|
57
|
+
| A08:2021 Data Integrity Failures | Insecure deserialization, unsigned data |
|
|
58
|
+
| A09:2021 Logging Failures | Missing logs, sensitive data in logs |
|
|
59
|
+
| A10:2021 SSRF | Server-side request forgery |
|
|
60
|
+
|
|
61
|
+
## Severity Guidelines
|
|
62
|
+
|
|
63
|
+
- **Critical**: Actively exploitable, high impact (RCE, data breach, auth bypass)
|
|
64
|
+
- **High**: Exploitable with some conditions, significant impact
|
|
65
|
+
- **Medium**: Potential risk, limited impact, requires specific conditions
|
|
66
|
+
- **Low**: Best practice violation, minimal direct risk
|
|
67
|
+
|
|
68
|
+
## Notes
|
|
69
|
+
|
|
70
|
+
Include in the `notes` field when relevant:
|
|
71
|
+
|
|
72
|
+
- Vulnerability type with CWE ID (e.g., "SQL Injection (CWE-89)")
|
|
73
|
+
- Risk assessment: what could happen if exploited
|
|
74
|
+
- OWASP category reference
|
|
75
|
+
- Attack vector or exploitation scenario
|
|
76
|
+
- Related vulnerabilities in the same flow
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# Style Analysis Reference
|
|
2
|
+
|
|
3
|
+
## Analysis Criteria
|
|
4
|
+
|
|
5
|
+
Focus on normalization - there should be ONE way of doing things. Majority pattern wins - align outliers to dominant pattern. Respect existing patterns and work with the codebase, not against it.
|
|
6
|
+
|
|
7
|
+
### Naming
|
|
8
|
+
|
|
9
|
+
- Inconsistent naming conventions across files
|
|
10
|
+
- Mixed camelCase/snake_case within same context
|
|
11
|
+
- Inconsistent abbreviations (btn vs button, msg vs message)
|
|
12
|
+
- Non-descriptive names that obscure intent
|
|
13
|
+
|
|
14
|
+
### Patterns
|
|
15
|
+
|
|
16
|
+
- Different ways of handling the same thing
|
|
17
|
+
- Inconsistent error handling patterns
|
|
18
|
+
- Mixed async patterns (callbacks vs promises vs async/await)
|
|
19
|
+
- Inconsistent component patterns in UI code
|
|
20
|
+
- Different state management approaches
|
|
21
|
+
|
|
22
|
+
### Structure
|
|
23
|
+
|
|
24
|
+
- Inconsistent file organization
|
|
25
|
+
- Mixed import styles (default vs named, relative vs absolute)
|
|
26
|
+
- Inconsistent export patterns (named vs default vs barrel)
|
|
27
|
+
- Module organization inconsistencies
|
|
28
|
+
|
|
29
|
+
### Formatting
|
|
30
|
+
|
|
31
|
+
- Issues not caught by automated formatters
|
|
32
|
+
- Inconsistent whitespace in logic blocks
|
|
33
|
+
- Comment style inconsistencies
|
|
34
|
+
- Inconsistent brace/bracket placement
|
|
35
|
+
|
|
36
|
+
## Pattern Detection Tables
|
|
37
|
+
|
|
38
|
+
### Naming Conventions
|
|
39
|
+
|
|
40
|
+
| Pattern | Variations to Detect |
|
|
41
|
+
| ---------- | --------------------------------------------------- |
|
|
42
|
+
| Functions | `getUserData` vs `get_user_data` vs `GetUserData` |
|
|
43
|
+
| Variables | `isLoading` vs `loading` vs `is_loading` |
|
|
44
|
+
| Constants | `MAX_RETRIES` vs `maxRetries` vs `MaxRetries` |
|
|
45
|
+
| Components | `UserCard` vs `userCard` vs `User_Card` |
|
|
46
|
+
| Files | `UserCard.tsx` vs `user-card.tsx` vs `userCard.tsx` |
|
|
47
|
+
|
|
48
|
+
### Code Patterns
|
|
49
|
+
|
|
50
|
+
| Area | Variations to Detect |
|
|
51
|
+
| -------------- | ----------------------------------------- |
|
|
52
|
+
| Error handling | try/catch vs .catch() vs error boundaries |
|
|
53
|
+
| Async | async/await vs .then() vs callbacks |
|
|
54
|
+
| State updates | setState vs reducer vs signals |
|
|
55
|
+
| Props | destructuring vs props.x |
|
|
56
|
+
| Exports | named vs default vs barrel files |
|
|
57
|
+
|
|
58
|
+
## Severity Guidelines
|
|
59
|
+
|
|
60
|
+
- **Critical**: Fundamental inconsistencies that significantly harm readability
|
|
61
|
+
- **High**: Major deviations from established patterns in key areas
|
|
62
|
+
- **Medium**: Noticeable inconsistencies that create friction
|
|
63
|
+
- **Low**: Minor style variations, cosmetic issues
|
|
64
|
+
|
|
65
|
+
## Notes
|
|
66
|
+
|
|
67
|
+
Include in the `notes` field when relevant:
|
|
68
|
+
|
|
69
|
+
- The established project standard for this pattern
|
|
70
|
+
- Count of files following majority pattern vs outliers
|
|
71
|
+
- Whether this is a naming, pattern, structure, or formatting issue
|
|
72
|
+
- Other files with the same inconsistency
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: af-create-checkpoint
|
|
3
|
+
description: Create a checkpoint to track progress and share context
|
|
4
|
+
argument-hint: <workflow-id> <step> <status> <context>
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Create Checkpoint
|
|
8
|
+
|
|
9
|
+
## Overview
|
|
10
|
+
|
|
11
|
+
Record progress and provide context for future sessions or other agents. Use this skill when completing milestones, handing off work, encountering issues, or reaching natural pause points. Creates a checkpoint entry that captures the current workflow state for resumption or handoff.
|
|
12
|
+
|
|
13
|
+
## Arguments
|
|
14
|
+
|
|
15
|
+
### Definitions
|
|
16
|
+
|
|
17
|
+
- **`<workflow-id>`** (required): The workflow identifier for output organization.
|
|
18
|
+
- **`<step>`** (required): Current step name (e.g., analyze, plan, review).
|
|
19
|
+
- **`<status>`** (required): Checkpoint status. Values: `in_progress`, `completed`.
|
|
20
|
+
- **`<context>`** (required): Summary of current situation and progress.
|
|
21
|
+
|
|
22
|
+
### Values
|
|
23
|
+
|
|
24
|
+
\$ARGUMENTS
|
|
25
|
+
|
|
26
|
+
## Core Principles
|
|
27
|
+
|
|
28
|
+
- Checkpoints are append-only within a workflow
|
|
29
|
+
- Include enough context for seamless resumption
|
|
30
|
+
- Note any blockers or issues discovered
|
|
31
|
+
- Track progress with markdown checklists
|
|
32
|
+
|
|
33
|
+
## Instructions
|
|
34
|
+
|
|
35
|
+
1. Parse the workflow-id, step name, and status
|
|
36
|
+
2. Generate checkpoint ID (chk-NNN)
|
|
37
|
+
3. Create checkpoint entry with:
|
|
38
|
+
- Context summary
|
|
39
|
+
- Progress checklist
|
|
40
|
+
- Notes for next session
|
|
41
|
+
- Issues discovered
|
|
42
|
+
4. Save to `agentic/outputs/{workflow-id}/checkpoint.md`
|
|
43
|
+
5. Return confirmation with checkpoint ID
|
|
44
|
+
|
|
45
|
+
## Output Guidance
|
|
46
|
+
|
|
47
|
+
Return JSON confirmation:
|
|
48
|
+
|
|
49
|
+
```json
|
|
50
|
+
{
|
|
51
|
+
"success": true,
|
|
52
|
+
"checkpoint_id": "chk-001",
|
|
53
|
+
"workflow_id": "abc123"
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Templates
|
|
58
|
+
|
|
59
|
+
### Checkpoint File Format
|
|
60
|
+
|
|
61
|
+
Checkpoints are stored in `agentic/outputs/{workflow-id}/checkpoint.md`:
|
|
62
|
+
|
|
63
|
+
```markdown
|
|
64
|
+
---
|
|
65
|
+
checkpoint_id: chk-001
|
|
66
|
+
step: build
|
|
67
|
+
created: 2024-01-15T14:30:00Z
|
|
68
|
+
workflow_id: abc-123
|
|
69
|
+
status: in_progress
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## Context
|
|
73
|
+
|
|
74
|
+
Summary of the current situation...
|
|
75
|
+
|
|
76
|
+
## Progress
|
|
77
|
+
|
|
78
|
+
- [x] Completed task
|
|
79
|
+
- [ ] Pending task
|
|
80
|
+
|
|
81
|
+
## Notes for Next Session
|
|
82
|
+
|
|
83
|
+
Important details...
|
|
84
|
+
|
|
85
|
+
## Issues Discovered
|
|
86
|
+
|
|
87
|
+
Problems found...
|
|
88
|
+
```
|