Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
b5bc7b8
fix: resolve merge conflicts and update dependencies for CI
Moikapy Jul 14, 2025
de16360
chore: update GitHub Actions to v4
Moikapy Jul 14, 2025
853b84c
fix: update CI Rust version to 1.88.0 for Edition 2024 support
Moikapy Jul 14, 2025
0aa99ad
fix: resolve remaining format string syntax errors
Moikapy Jul 14, 2025
e39013f
fix: correct format string syntax in cranelift translator
Moikapy Jul 14, 2025
8cbf2bc
fix: partial format string fixes for CI
Moikapy Jul 14, 2025
27b2876
fix: resolve all remaining format string syntax errors
Moikapy Jul 14, 2025
f3627b2
fix: resolve remaining compilation errors and API compatibility issues
Moikapy Jul 14, 2025
54109bf
Fix format string syntax errors discovered by CI
Moikapy Jul 14, 2025
0235417
Fix missing closing parentheses in assert\! macros in inference tests
Moikapy Jul 14, 2025
44b1ae2
Fix remaining format string syntax errors in src/main.rs
Moikapy Jul 14, 2025
b223216
Fix format string error on line 806 in main.rs
Moikapy Jul 14, 2025
eeb4202
Update README to align with current kb/ and src/ structure
Moikapy Jul 14, 2025
95fe3db
Fix format string error on line 847 in main.rs
Moikapy Jul 14, 2025
c40ff37
Enhance benchmark configurations and CI safety
Moikapy Jul 14, 2025
06b8a4d
Fix dereference error in closure_performance.rs
Moikapy Jul 14, 2025
90ac435
Add missing Traceable trait import in closure_performance.rs
Moikapy Jul 14, 2025
e6bf28d
Fix multiple issues in closure_performance.rs
Moikapy Jul 14, 2025
db52f19
Fix compilation errors in cycle_detection_bench.rs
Moikapy Jul 15, 2025
8e80de3
Fix compilation errors in monomorphization_bench.rs
Moikapy Jul 15, 2025
a6a033f
Fix compilation errors in async_integration_test.rs
Moikapy Jul 15, 2025
cf655fc
fix: resolve compilation errors in async_secure_integration.rs
Moikapy Jul 15, 2025
aea17e2
fix: resolve remaining benchmark compilation errors
Moikapy Jul 15, 2025
3f61ef7
fix: resolve mismatched closing delimiter errors in parser/tests.rs
Moikapy Jul 15, 2025
94899e0
fix: resolve type mismatch and unused imports in generic_test_helpers.rs
Moikapy Jul 15, 2025
ebe7e00
fix: resolve mismatched closing delimiter errors in main.rs
Moikapy Jul 15, 2025
9bfcf65
fix: resolve remaining format string syntax errors in main.rs
Moikapy Jul 15, 2025
0c0f46e
fix: resolve invalid format string errors in parser/tests.rs
Moikapy Jul 15, 2025
fb55786
feat: comprehensive security audit and improvements for debugger runt…
Moikapy Jul 15, 2025
2b0632c
docs: add security audit reports and command documentation
Moikapy Jul 15, 2025
8d9f203
fix: resolve compilation errors and improve API consistency
Moikapy Jul 15, 2025
2114705
feat: enhance testing and security infrastructure
Moikapy Jul 15, 2025
fe33cee
feat: enhance configuration management and improve session variable h…
Moikapy Jul 15, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 100 additions & 0 deletions .claude/commands/audit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@

# /audit Custom Command Documentation

## Overview

The `/audit` command is a custom tool designed for use in Claude Code (based on Anthropic's Claude AI coding assistant). It enables developers to perform automated audits on selected code snippets or entire files, focusing on three key areas:

- **Security Issues**: Identification of potential vulnerabilities, unsafe practices, and security risks.
- **Optimizations**: Suggestions for improving code efficiency, performance, and resource usage.
- **Incomplete Logic**: Detection of missing edge cases, unfinished implementations, or logical gaps.

This command leverages the `mcp_code-audit_audit_code` tool to conduct thorough analyses and generates reports that can be logged directly into the project's knowledge base (kb/) for tracking and resolution.

## Purpose

The primary goal of `/audit` is to enhance code quality by providing actionable insights during development. It helps maintain high standards in the Script language project by:
- Ensuring secure coding practices in async operations, closures, and FFI interactions.
- Optimizing runtime performance, especially in areas like async transformations and garbage collection.
- Verifying complete and robust logic in parsers, semantic analyzers, and code generators.

By integrating with the knowledge base, it facilitates team collaboration on issue resolution and maintains a historical record of audits.

## Usage

1. **Invocation**:
- In the Cursor editor (or compatible IDE with Claude integration), select the code you want to audit.
- Type `/audit` in the chat interface to invoke the command.
- Optionally, specify parameters like audit type (e.g., "security", "performance", "all").

2. **Parameters**:
- **code**: The selected code snippet (automatically provided).
- **language**: Automatically detected, but can be specified (e.g., "rust" for Script's backend).
- **auditType**: Optional; defaults to "all". Options: "security", "performance", "quality", "completeness", etc.
- **includeFixSuggestions**: Boolean; defaults to true for solution proposals.

3. **Process**:
- Claude will call the `mcp_code-audit_audit_code` tool with the provided code and parameters.
- The tool performs a comprehensive audit using AI models.
- Results are analyzed, and if issues are found, they are formatted and logged to the knowledge base.

4. **Output**:
- A summary of findings in the chat.
- If issues are detected, a new Markdown file is created in `kb/active/` using the `mcp_kb_update` tool.
- Notification of the new KB entry for tracking.

## Integration with Tools

- **Audit Tool**: Uses `mcp_code-audit_audit_code` for the core auditing logic. This tool supports various audit types and provides detailed reports with fix suggestions.
- **Knowledge Base Integration**: Issues are stored in `kb/active/[ISSUE_NAME].md` with a structured format for easy reference.
- **Error Handling**: If the audit tool fails or access is denied, fallback to manual review prompts.

## Example Workflow

1. Select code in `src/runtime/async_ffi.rs`.
2. Invoke `/audit`.
3. Claude runs the audit and finds a security issue.
4. A new file `kb/active/ASYNC_FFI_SECURITY_ISSUE.md` is created with details.

## Issue Format in Knowledge Base

Each issue file in `kb/active/` follows this structure:

```
# [Issue Title]

## File Path
[path/to/file.rs]

## Issue Description
[Detailed description of the issue, including type (security/optimization/incomplete logic)]

## Severity
[Low/Medium/High/Critical]

## Solutions
- [Solution 1]
- [Solution 2]
- ...

## Additional Notes
[Any extra context or references]
```

## Best Practices

- Run `/audit` frequently during development, especially after major changes.
- Use specific audit types for focused reviews (e.g., "security" for async code).
- Review and verify AI-generated suggestions before implementation.
- Update the KB entry to "completed/" once resolved.

## Limitations

- Dependent on the accuracy of the underlying AI audit models.
- May not catch all issues; combine with manual code reviews.
- Requires proper configuration of MCP tools and access permissions.

For more details on Claude Code, refer to: https://docs.anthropic.com/en/docs/claude-code/overview

This documentation ensures the `/audit` command is used effectively to maintain high-quality code in the Script project.

Loading
Loading