devflow-kit 0.4.0 â 0.6.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/CHANGELOG.md +129 -0
- package/README.md +61 -9
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +160 -176
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/uninstall.d.ts.map +1 -1
- package/dist/commands/uninstall.js +73 -48
- package/dist/commands/uninstall.js.map +1 -1
- package/dist/utils/git.d.ts +11 -0
- package/dist/utils/git.d.ts.map +1 -0
- package/dist/utils/git.js +36 -0
- package/dist/utils/git.js.map +1 -0
- package/dist/utils/paths.d.ts +32 -0
- package/dist/utils/paths.d.ts.map +1 -0
- package/dist/utils/paths.js +86 -0
- package/dist/utils/paths.js.map +1 -0
- package/package.json +1 -1
- package/src/claude/agents/devflow/audit-architecture.md +92 -110
- package/src/claude/agents/devflow/audit-complexity.md +94 -130
- package/src/claude/agents/devflow/audit-database.md +95 -136
- package/src/claude/agents/devflow/audit-dependencies.md +94 -136
- package/src/claude/agents/devflow/audit-documentation.md +82 -323
- package/src/claude/agents/devflow/audit-performance.md +212 -107
- package/src/claude/agents/devflow/audit-security.md +201 -83
- package/src/claude/agents/devflow/audit-tests.md +82 -471
- package/src/claude/agents/devflow/audit-typescript.md +83 -311
- package/src/claude/agents/devflow/pull-request.md +423 -0
- package/src/claude/commands/devflow/code-review.md +297 -248
- package/src/claude/commands/devflow/plan-next-steps.md +1 -1
- package/src/claude/commands/devflow/plan.md +485 -0
- package/src/claude/commands/devflow/pull-request.md +269 -0
- package/src/claude/commands/devflow/resolve-comments.md +583 -0
- package/src/claude/scripts/statusline.sh +0 -36
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uninstall.js","sourceRoot":"","sources":["../../src/cli/commands/uninstall.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,QAAQ,IA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QACN,OAAO,CAAC,GAAG,CAAC,sCAAsC,CAAC,CAAC;IACtD,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,+DAA+D,CAAC,CAAC;AAC/E,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Get git repository root directory (async, non-blocking)
|
|
3
|
+
* Returns null if not in a git repository
|
|
4
|
+
*
|
|
5
|
+
* Security: Validates output to prevent command injection
|
|
6
|
+
* - Rejects paths with injection characters (newlines, semicolons, shell operators)
|
|
7
|
+
* - Ensures path is absolute
|
|
8
|
+
* - Resolves path canonically
|
|
9
|
+
*/
|
|
10
|
+
export declare function getGitRoot(): Promise<string | null>;
|
|
11
|
+
//# sourceMappingURL=git.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../../src/cli/utils/git.ts"],"names":[],"mappings":"AAMA;;;;;;;;GAQG;AACH,wBAAsB,UAAU,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAwBzD"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { exec } from 'child_process';
|
|
2
|
+
import { promisify } from 'util';
|
|
3
|
+
import * as path from 'path';
|
|
4
|
+
const execAsync = promisify(exec);
|
|
5
|
+
/**
|
|
6
|
+
* Get git repository root directory (async, non-blocking)
|
|
7
|
+
* Returns null if not in a git repository
|
|
8
|
+
*
|
|
9
|
+
* Security: Validates output to prevent command injection
|
|
10
|
+
* - Rejects paths with injection characters (newlines, semicolons, shell operators)
|
|
11
|
+
* - Ensures path is absolute
|
|
12
|
+
* - Resolves path canonically
|
|
13
|
+
*/
|
|
14
|
+
export async function getGitRoot() {
|
|
15
|
+
try {
|
|
16
|
+
const { stdout } = await execAsync('git rev-parse --show-toplevel', {
|
|
17
|
+
cwd: process.cwd(),
|
|
18
|
+
encoding: 'utf-8'
|
|
19
|
+
});
|
|
20
|
+
const gitRootRaw = stdout.trim();
|
|
21
|
+
// Validate git root path (security: prevent injection)
|
|
22
|
+
if (!gitRootRaw || gitRootRaw.includes('\n') || gitRootRaw.includes(';') || gitRootRaw.includes('&&')) {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
// Validate it's an absolute path
|
|
26
|
+
const gitRoot = path.resolve(gitRootRaw);
|
|
27
|
+
if (!path.isAbsolute(gitRoot)) {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
return gitRoot;
|
|
31
|
+
}
|
|
32
|
+
catch {
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=git.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git.js","sourceRoot":"","sources":["../../src/cli/utils/git.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AACjC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B,MAAM,SAAS,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;AAElC;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU;IAC9B,IAAI,CAAC;QACH,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,SAAS,CAAC,+BAA+B,EAAE;YAClE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE;YAClB,QAAQ,EAAE,OAAO;SAClB,CAAC,CAAC;QAEH,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC;QAEjC,uDAAuD;QACvD,IAAI,CAAC,UAAU,IAAI,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;YACtG,OAAO,IAAI,CAAC;QACd,CAAC;QAED,iCAAiC;QACjC,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QACzC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;YAC9B,OAAO,IAAI,CAAC;QACd,CAAC;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Get home directory with proper fallback and validation
|
|
3
|
+
* Priority: process.env.HOME > os.homedir()
|
|
4
|
+
*
|
|
5
|
+
* @throws {Error} If unable to determine home directory
|
|
6
|
+
*/
|
|
7
|
+
export declare function getHomeDirectory(): string;
|
|
8
|
+
/**
|
|
9
|
+
* Get Claude Code directory with environment variable override support
|
|
10
|
+
* Priority: CLAUDE_CODE_DIR env var > ~/.claude
|
|
11
|
+
*
|
|
12
|
+
* @throws {Error} If CLAUDE_CODE_DIR is invalid (not absolute, outside home)
|
|
13
|
+
*/
|
|
14
|
+
export declare function getClaudeDirectory(): string;
|
|
15
|
+
/**
|
|
16
|
+
* Get DevFlow directory with environment variable override support
|
|
17
|
+
* Priority: DEVFLOW_DIR env var > ~/.devflow
|
|
18
|
+
*
|
|
19
|
+
* @throws {Error} If DEVFLOW_DIR is invalid (not absolute, outside home)
|
|
20
|
+
*/
|
|
21
|
+
export declare function getDevFlowDirectory(): string;
|
|
22
|
+
/**
|
|
23
|
+
* Get installation paths based on scope (async, non-blocking)
|
|
24
|
+
* @param scope - 'user' or 'local'
|
|
25
|
+
* @returns Object with claudeDir and devflowDir
|
|
26
|
+
* @throws {Error} If local scope selected but not in a git repository
|
|
27
|
+
*/
|
|
28
|
+
export declare function getInstallationPaths(scope: 'user' | 'local'): Promise<{
|
|
29
|
+
claudeDir: string;
|
|
30
|
+
devflowDir: string;
|
|
31
|
+
}>;
|
|
32
|
+
//# sourceMappingURL=paths.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../src/cli/utils/paths.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,CAMzC;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,CAkB3C;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,CAkB5C;AAED;;;;;GAKG;AACH,wBAAsB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAAC,CAiBtH"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { homedir } from 'os';
|
|
2
|
+
import * as path from 'path';
|
|
3
|
+
import { getGitRoot } from './git.js';
|
|
4
|
+
/**
|
|
5
|
+
* Get home directory with proper fallback and validation
|
|
6
|
+
* Priority: process.env.HOME > os.homedir()
|
|
7
|
+
*
|
|
8
|
+
* @throws {Error} If unable to determine home directory
|
|
9
|
+
*/
|
|
10
|
+
export function getHomeDirectory() {
|
|
11
|
+
const home = process.env.HOME || homedir();
|
|
12
|
+
if (!home) {
|
|
13
|
+
throw new Error('Unable to determine home directory. Set HOME environment variable.');
|
|
14
|
+
}
|
|
15
|
+
return home;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Get Claude Code directory with environment variable override support
|
|
19
|
+
* Priority: CLAUDE_CODE_DIR env var > ~/.claude
|
|
20
|
+
*
|
|
21
|
+
* @throws {Error} If CLAUDE_CODE_DIR is invalid (not absolute, outside home)
|
|
22
|
+
*/
|
|
23
|
+
export function getClaudeDirectory() {
|
|
24
|
+
if (process.env.CLAUDE_CODE_DIR) {
|
|
25
|
+
const customDir = process.env.CLAUDE_CODE_DIR;
|
|
26
|
+
// Validate path is absolute
|
|
27
|
+
if (!path.isAbsolute(customDir)) {
|
|
28
|
+
throw new Error('CLAUDE_CODE_DIR must be an absolute path');
|
|
29
|
+
}
|
|
30
|
+
// Warn if outside home directory (security best practice)
|
|
31
|
+
const home = getHomeDirectory();
|
|
32
|
+
if (!customDir.startsWith(home)) {
|
|
33
|
+
console.warn('â ī¸ CLAUDE_CODE_DIR is outside home directory. Ensure this is intentional.');
|
|
34
|
+
}
|
|
35
|
+
return customDir;
|
|
36
|
+
}
|
|
37
|
+
return path.join(getHomeDirectory(), '.claude');
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Get DevFlow directory with environment variable override support
|
|
41
|
+
* Priority: DEVFLOW_DIR env var > ~/.devflow
|
|
42
|
+
*
|
|
43
|
+
* @throws {Error} If DEVFLOW_DIR is invalid (not absolute, outside home)
|
|
44
|
+
*/
|
|
45
|
+
export function getDevFlowDirectory() {
|
|
46
|
+
if (process.env.DEVFLOW_DIR) {
|
|
47
|
+
const customDir = process.env.DEVFLOW_DIR;
|
|
48
|
+
// Validate path is absolute
|
|
49
|
+
if (!path.isAbsolute(customDir)) {
|
|
50
|
+
throw new Error('DEVFLOW_DIR must be an absolute path');
|
|
51
|
+
}
|
|
52
|
+
// Warn if outside home directory (security best practice)
|
|
53
|
+
const home = getHomeDirectory();
|
|
54
|
+
if (!customDir.startsWith(home)) {
|
|
55
|
+
console.warn('â ī¸ DEVFLOW_DIR is outside home directory. Ensure this is intentional.');
|
|
56
|
+
}
|
|
57
|
+
return customDir;
|
|
58
|
+
}
|
|
59
|
+
return path.join(getHomeDirectory(), '.devflow');
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Get installation paths based on scope (async, non-blocking)
|
|
63
|
+
* @param scope - 'user' or 'local'
|
|
64
|
+
* @returns Object with claudeDir and devflowDir
|
|
65
|
+
* @throws {Error} If local scope selected but not in a git repository
|
|
66
|
+
*/
|
|
67
|
+
export async function getInstallationPaths(scope) {
|
|
68
|
+
if (scope === 'user') {
|
|
69
|
+
return {
|
|
70
|
+
claudeDir: getClaudeDirectory(),
|
|
71
|
+
devflowDir: getDevFlowDirectory()
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
// Local scope - install to git repository root
|
|
76
|
+
const gitRoot = await getGitRoot();
|
|
77
|
+
if (!gitRoot) {
|
|
78
|
+
throw new Error('Local scope requires a git repository. Run "git init" first or use --scope user');
|
|
79
|
+
}
|
|
80
|
+
return {
|
|
81
|
+
claudeDir: path.join(gitRoot, '.claude'),
|
|
82
|
+
devflowDir: path.join(gitRoot, '.devflow')
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=paths.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.js","sourceRoot":"","sources":["../../src/cli/utils/paths.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAC7B,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEtC;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB;IAC9B,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,OAAO,EAAE,CAAC;IAC3C,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,MAAM,IAAI,KAAK,CAAC,oEAAoE,CAAC,CAAC;IACxF,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB;IAChC,IAAI,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,CAAC;QAChC,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC;QAE9C,4BAA4B;QAC5B,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;YAChC,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAC;QAC9D,CAAC;QAED,0DAA0D;QAC1D,MAA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,KAAK,CAAC,iFAAiF,CAAC,CAAC;QACrG,CAAC;QACD,OAAO;YACL,SAAS,EAAE,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,SAAS,CAAC;YACxC,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,UAAU,CAAC;SAC3C,CAAC;IACJ,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -5,146 +5,128 @@ tools: Read, Grep, Glob, Bash
|
|
|
5
5
|
model: inherit
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
You are
|
|
8
|
+
You are a architecture audit specialist focused on software architecture and design pattern analysis.
|
|
9
9
|
|
|
10
|
-
##
|
|
10
|
+
## Your Task
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
- Anti-pattern detection
|
|
16
|
-
- Dependency injection usage
|
|
17
|
-
- Inversion of control
|
|
18
|
-
- Single responsibility adherence
|
|
19
|
-
|
|
20
|
-
### 2. Code Organization
|
|
21
|
-
- Module boundaries and cohesion
|
|
22
|
-
- Coupling analysis
|
|
23
|
-
- Layer separation
|
|
24
|
-
- Package/namespace organization
|
|
25
|
-
- Circular dependency detection
|
|
26
|
-
- Interface segregation
|
|
27
|
-
|
|
28
|
-
### 3. System Architecture
|
|
29
|
-
- Microservices vs monolith decisions
|
|
30
|
-
- Service boundaries
|
|
31
|
-
- Data flow patterns
|
|
32
|
-
- Event-driven architecture
|
|
33
|
-
- API design consistency
|
|
34
|
-
- Service communication patterns
|
|
35
|
-
|
|
36
|
-
### 4. Data Management
|
|
37
|
-
- Repository pattern implementation
|
|
38
|
-
- Data access layer organization
|
|
39
|
-
- Domain model design
|
|
40
|
-
- Entity relationship modeling
|
|
41
|
-
- Data consistency patterns
|
|
42
|
-
- Transaction boundary design
|
|
43
|
-
|
|
44
|
-
### 5. Error Handling & Resilience
|
|
45
|
-
- Exception handling patterns
|
|
46
|
-
- Retry mechanisms
|
|
47
|
-
- Circuit breaker patterns
|
|
48
|
-
- Graceful degradation
|
|
49
|
-
- Timeout handling
|
|
50
|
-
- Resource cleanup patterns
|
|
51
|
-
|
|
52
|
-
### 6. Testing Architecture
|
|
53
|
-
- Test pyramid structure
|
|
54
|
-
- Mock and stub usage
|
|
55
|
-
- Integration test boundaries
|
|
56
|
-
- Test data management
|
|
57
|
-
- Test isolation
|
|
58
|
-
- Testability design
|
|
59
|
-
|
|
60
|
-
## Analysis Approach
|
|
61
|
-
|
|
62
|
-
1. **Map dependencies** and analyze coupling
|
|
63
|
-
2. **Identify architectural layers** and boundaries
|
|
64
|
-
3. **Assess pattern consistency** across codebase
|
|
65
|
-
4. **Check adherence** to established principles
|
|
66
|
-
5. **Evaluate scalability** and maintainability
|
|
67
|
-
|
|
68
|
-
## Output Format
|
|
69
|
-
|
|
70
|
-
Classify findings by architectural impact:
|
|
71
|
-
- **CRITICAL**: Fundamental architectural flaws
|
|
72
|
-
- **HIGH**: Significant design issues
|
|
73
|
-
- **MEDIUM**: Pattern inconsistencies
|
|
74
|
-
- **LOW**: Minor organizational improvements
|
|
75
|
-
|
|
76
|
-
For each finding, include:
|
|
77
|
-
- Architecture component affected
|
|
78
|
-
- Design principle or pattern involved
|
|
79
|
-
- Impact on maintainability/scalability
|
|
80
|
-
- Refactoring recommendations
|
|
81
|
-
- Example implementations
|
|
82
|
-
- Migration strategies for large changes
|
|
83
|
-
|
|
84
|
-
Focus on structural issues that affect long-term maintainability and team productivity.
|
|
85
|
-
|
|
86
|
-
## Report Storage
|
|
87
|
-
|
|
88
|
-
**IMPORTANT**: When invoked by `/code-review`, save your audit report to the standardized location:
|
|
12
|
+
Analyze code changes in the current branch for architecture issues, with laser focus on lines that were actually modified.
|
|
13
|
+
|
|
14
|
+
### Step 1: Identify Changed Lines
|
|
89
15
|
|
|
90
16
|
```bash
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
17
|
+
BASE_BRANCH=""
|
|
18
|
+
for branch in main master develop; do
|
|
19
|
+
if git show-ref --verify --quiet refs/heads/$branch; then
|
|
20
|
+
BASE_BRANCH=$branch; break
|
|
21
|
+
fi
|
|
22
|
+
done
|
|
23
|
+
git diff --name-only $BASE_BRANCH...HEAD > /tmp/changed_files.txt
|
|
24
|
+
git diff $BASE_BRANCH...HEAD > /tmp/full_diff.txt
|
|
25
|
+
git diff $BASE_BRANCH...HEAD --unified=0 | grep -E '^@@' > /tmp/changed_lines.txt
|
|
26
|
+
```
|
|
95
27
|
|
|
96
|
-
|
|
97
|
-
REPORT_FILE="${AUDIT_BASE_DIR}/architecture-report.${TIMESTAMP}.md"
|
|
28
|
+
### Step 2: Analyze in Three Categories
|
|
98
29
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
30
|
+
**đ´ Category 1: Issues in Your Changes (BLOCKING)**
|
|
31
|
+
- Lines ADDED or MODIFIED in this branch
|
|
32
|
+
- NEW issues introduced by this PR
|
|
33
|
+
- **Priority:** BLOCKING - must fix before merge
|
|
102
34
|
|
|
103
|
-
**
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
**
|
|
35
|
+
**â ī¸ Category 2: Issues in Code You Touched (Should Fix)**
|
|
36
|
+
- Lines in functions/modules you modified
|
|
37
|
+
- Issues near your changes
|
|
38
|
+
- **Priority:** HIGH - should fix while you're here
|
|
107
39
|
|
|
108
|
-
|
|
40
|
+
**âšī¸ Category 3: Pre-existing Issues (Not Blocking)**
|
|
41
|
+
- Issues in files you reviewed but didn't modify
|
|
42
|
+
- Legacy problems unrelated to this PR
|
|
43
|
+
- **Priority:** INFORMATIONAL - fix in separate PR
|
|
109
44
|
|
|
110
|
-
|
|
45
|
+
### Step 3: Architecture Analysis
|
|
111
46
|
|
|
112
|
-
{Brief summary of architectural quality}
|
|
113
47
|
|
|
114
|
-
|
|
48
|
+
**Pattern Violations:**
|
|
49
|
+
- SOLID principles violations
|
|
50
|
+
- Design pattern misuse
|
|
51
|
+
- Tight coupling
|
|
52
|
+
- God objects/classes
|
|
53
|
+
|
|
54
|
+
**Architecture Quality:**
|
|
55
|
+
- Separation of concerns
|
|
56
|
+
- Dependency direction
|
|
57
|
+
- Layer violations
|
|
58
|
+
- Module boundaries
|
|
59
|
+
|
|
60
|
+
**Code Organization:**
|
|
61
|
+
- File/folder structure
|
|
62
|
+
- Naming conventions
|
|
63
|
+
- Interface design
|
|
64
|
+
- Abstraction levels
|
|
115
65
|
|
|
116
|
-
|
|
66
|
+
### Step 4: Generate Report
|
|
117
67
|
|
|
118
|
-
|
|
68
|
+
```markdown
|
|
69
|
+
# Architecture Audit Report
|
|
70
|
+
|
|
71
|
+
**Branch**: ${CURRENT_BRANCH}
|
|
72
|
+
**Base**: ${BASE_BRANCH}
|
|
73
|
+
**Date**: $(date +%Y-%m-%d %H:%M:%S)
|
|
119
74
|
|
|
120
75
|
---
|
|
121
76
|
|
|
122
|
-
##
|
|
77
|
+
## đ´ Issues in Your Changes (BLOCKING)
|
|
123
78
|
|
|
124
|
-
{
|
|
79
|
+
{Issues introduced in lines you added or modified}
|
|
125
80
|
|
|
126
81
|
---
|
|
127
82
|
|
|
128
|
-
##
|
|
83
|
+
## â ī¸ Issues in Code You Touched (Should Fix)
|
|
129
84
|
|
|
130
|
-
{
|
|
85
|
+
{Issues in code you modified or functions you updated}
|
|
131
86
|
|
|
132
87
|
---
|
|
133
88
|
|
|
134
|
-
##
|
|
89
|
+
## âšī¸ Pre-existing Issues (Not Blocking)
|
|
135
90
|
|
|
136
|
-
{
|
|
91
|
+
{Issues in files you reviewed but didn't modify}
|
|
137
92
|
|
|
138
93
|
---
|
|
139
94
|
|
|
140
|
-
##
|
|
95
|
+
## Summary
|
|
141
96
|
|
|
142
|
-
**
|
|
97
|
+
**Your Changes:**
|
|
98
|
+
- đ´ CRITICAL/HIGH/MEDIUM counts
|
|
143
99
|
|
|
144
|
-
|
|
100
|
+
**Code You Touched:**
|
|
101
|
+
- â ī¸ HIGH/MEDIUM counts
|
|
145
102
|
|
|
146
|
-
|
|
103
|
+
**Pre-existing:**
|
|
104
|
+
- âšī¸ MEDIUM/LOW counts
|
|
105
|
+
|
|
106
|
+
**Architecture Score**: {X}/10
|
|
107
|
+
|
|
108
|
+
**Merge Recommendation**:
|
|
109
|
+
- â BLOCK (if critical issues in your changes)
|
|
110
|
+
- â ī¸ REVIEW REQUIRED (if high issues)
|
|
111
|
+
- â
APPROVED WITH CONDITIONS
|
|
112
|
+
- â
APPROVED
|
|
147
113
|
```
|
|
148
114
|
|
|
149
|
-
|
|
150
|
-
|
|
115
|
+
### Step 5: Save Report
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
REPORT_FILE="${AUDIT_BASE_DIR}/architecture-report.${TIMESTAMP}.md"
|
|
119
|
+
mkdir -p "$(dirname "$REPORT_FILE")"
|
|
120
|
+
cat > "$REPORT_FILE" <<'REPORT'
|
|
121
|
+
{Generated report content}
|
|
122
|
+
REPORT
|
|
123
|
+
echo "â
Architecture audit saved: $REPORT_FILE"
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## Key Principles
|
|
127
|
+
|
|
128
|
+
1. **Focus on changed lines first** - Developer introduced these
|
|
129
|
+
2. **Context matters** - Issues near changes should be fixed together
|
|
130
|
+
3. **Be fair** - Don't block PRs for legacy code
|
|
131
|
+
4. **Be specific** - Exact file:line with examples
|
|
132
|
+
5. **Be actionable** - Clear fixes
|