视觉画布设计
canvas-design
基于设计原则创作静态视觉作品,用于海报与品牌图形。
accelint-ts-audit-all【文档与办公】Comprehensive TypeScript file audit system. Command-only skill (no natural triggers). Accepts file or directory path to systematically audit through accelint-ts-testing, accelint-ts-best-practices, accelint-ts-performance, and accelint-ts-documentation skills. Maintains progress tracking across sessions with interactive change approval. Uses isolated…
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Comprehensive TypeScript file audit system that systematically applies multiple audit skills with progress tracking and interactive approval.
accelint-ts-testing before any code changes.npm test, bun test, or similar unless they match the documented commands exactly.// PERF: comments when they provide meaningful insight that future developers wouldn't discover on their own.Apply these tests before launching a comprehensive audit:
.agents/audit/ before creating new ones.This skill creates and maintains an audit process file that tracks progress across sessions. It systematically runs four audit skills on each file with interactive approval.
Check for existing audit: Look in .agents/audit/ directory (in the original repository root) for existing audit-process files.
Note: Ensure .agents/audit/ is in your project's .gitignore to prevent committing audit tracking files.
If resuming an existing audit, read the audit-process file to understand current status:
Check completion status:
Check worktree status (backwards compatibility):
Continue from "Resume Instructions" section
Skip to Step 2 if resuming.
For new audits, create isolated worktree:
BLOCKING: All audit work MUST happen in an isolated worktree to prevent conflicts with parallel audits and allow safe rollback.
Create worktree with timestamped branch:
timestamp=$(date +%Y%m%d-%H%M%S)
git worktree add .agents/worktrees/audit-${timestamp} -b audit/${timestamp}
Switch to the worktree directory:
cd .agents/worktrees/audit-${timestamp}
Log the worktree path - You will work in this directory for the entire audit
Important: The worktree is created in .agents/worktrees/ (not .agents/audit/) to avoid conflicts with the gitignored .agents/audit/ directory where tracking files are stored.
Create tracking files:
MANDATORY - READ ENTIRE FILE: Before creating any tracking files, you MUST read
assets/audit-process-template.md completely
from start to finish to understand the exact format and structure required.
NEVER set any range limits when reading this file.
Similarly, you MUST read assets/audit-history-template.md
to understand the archival format.
Do NOT load these templates again after the initial setup - they are only needed once at the start of a new audit.
Create timestamped tracking files in the ORIGINAL repository (not in the worktree):
cd $(git rev-parse --show-toplevel).agents/audit/audit-process-${timestamp}.md (use same timestamp as worktree).agents/audit/audit-history-${timestamp}.md (same timestamp)cd .agents/worktrees/audit-${timestamp}Important: Tracking files live in the original repo's .agents/audit/ directory (which should be gitignored) so they are NOT committed with audit changes.
Build the TODO list:
Find all TypeScript files in the target directory, excluding .test.ts, .spec.ts, and .bench.ts files. If given a single file, validate it's not a test/benchmark file.
Populate the audit-process file:
For each file in the pending list, follow this exact sequence:
Step 1: Run accelint-ts-testing skill
Invoke the accelint-ts-testing skill.
[file-path]
Step 2: Interactive Changes
BLOCKING - Interactive Approval Required:
You MUST complete all three checkpoints before proceeding:
- ✅ Display emoji severity table with ALL issues (see "Interactive Change Approval Pattern")
- ✅ Show detailed before/after code for EVERY issue
- ✅ Ask "Apply which issues?" with numbered list acceptance NO EXCEPTIONS. If you skip any checkpoint, you are violating the workflow.
# Run test suite 100 times to verify PBT stability
for i in {1..100}; do <test-command> || break; done
Step 3: Run BOTH skills in parallel
CRITICAL: Run these together to avoid contradictory suggestions:
Invoke the accelint-ts-best-practices skill.
[file-path]
Step 8: Interactive Changes
BLOCKING - Interactive Approval Required:
You MUST complete all three checkpoints before proceeding:
- ✅ Display emoji severity table with ALL documentation issues (see "Interactive Change Approval Pattern")
- ✅ Show detailed before/after code for EVERY issue
- ✅ Ask "Apply which issues?" with numbered list acceptance NO EXCEPTIONS. If you skip any checkpoint, you are violating the workflow.
When all 9 steps complete for a file:
Move detailed progress to history file
Update audit-process file
Save both files
If more pending files exist:
If all files completed:
Run final verification in worktree:
Merge worktree back to original branch:
# Extract timestamp from current worktree directory name
# We're in .agents/worktrees/audit-YYYYMMDD-HHMMSS
timestamp=$(basename $(pwd) | sed 's/audit-//')
# Get the original branch from this audit's process file (in original repo)
repo_root=$(git rev-parse --show-toplevel)
audit_process_file="${repo_root}/.agents/audit/audit-process-${timestamp}.md"
original_branch=$(grep "^**Original Branch:**" ${audit_process_file} | cut -d'`' -f2)
# Commit all changes in worktree
git add -A
git commit -m "refactor: complete TypeScript audit
- Improved test coverage across all files
- Applied type safety and best practice improvements
- Optimized performance where beneficial
- Enhanced documentation
Co-Authored-By: {current_model}"
# Switch back to original branch
cd "${repo_root}"
git checkout ${original_branch}
# Merge the audit branch
git merge --no-ff audit/${timestamp}
Clean up worktree:
# Remove the worktree (use the timestamp extracted earlier)
git worktree remove .agents/worktrees/audit-${timestamp}
# Optionally delete the audit branch
git branch -d audit/${timestamp}
Update audit-process file with completion:
Report results:
File Status Markers:
[ ] - Pending (not started)[x] - Completed (all 9 steps done, moved to history)Step Status Markers:
Detailed Progress Template:
### filename.ts - Audit Status 🔄 IN PROGRESS
**Overall Progress:** X% complete (Step Y of 8)
#### ✅ Step 1: Test Coverage - COMPLETE
[Findings, changes applied, test results]
#### 🔄 Step 2: Interactive Changes - IN PROGRESS
[Current change being reviewed, user decision needed]
#### ⏸️ Step 3: Code Quality Analysis - PENDING
[Not started yet]
CRITICAL: Always use the two-phase presentation pattern. NEVER present issues one-by-one or ask for approval before showing all changes.
Present ALL issues in a numbered table using emoji severity indicators:
## Found Issues Summary (X total)
| # | Severity | Type | Lines | Description |
|---|----------|------|-------|-------------|
| 1 | 🛑 Critical | Type Safety | 45-47 | Missing null check on user object |
| 2 | ⚠️ High | Performance | 89 | N+1 query in loop - use batch fetch |
| 3 | ⚡ Medium | Performance | 120-125 | Filter+map → single pass with reduce |
| 4 | 🔵 Low | Best Practice | 78 | Use const assertion for readonly array |
| 5 | ✅ Info | Documentation | 12 | Missing JSDoc return type |
Severity Legend:
After showing the overview table, display each issue with complete before/after code:
---
### Issue #1: Missing null check (🛑 Critical - Type Safety)
**Lines:** 45-47
**Problem:** Function doesn't handle null user case
**Impact:** Runtime TypeError when user is null
❌ **Before:**
```typescript
function getUsername(user: User | null) {
return user.name; // TS error + runtime crash
}
✅ After:
function getUsername(user: User | null) {
return user?.name ?? 'Anonymous';
}
Expected Benefit: Prevents runtime TypeError, fixes TS compilation error
[... same detailed format for each issue ...]
[... same detailed format for each issue ...]
[Continue for all issues...]
Apply which issues? Enter numbers (e.g., "1, 2, 5" or "all" or "skip"):
**Key Benefits:**
- Overview table allows quick scanning for conflicts across parallel processes
- Numbered list makes acceptance explicit and trackable
- All code changes shown upfront before any approval
- Emoji severity indicators enable instant visual prioritization
- Consistent format prevents wildly varying presentations
Wait for user response with numbered list before applying any changes.
## Verification Commands
The audit-process file MUST document exact verification commands. Common patterns:
**Node.js projects:**
```bash
cd <project-root>; npm test
cd <project-root>; npm run build
cd <project-root>; npm run lint
Bun projects:
cd <project-root>; bun run test
cd <project-root>; bun run build
cd <project-root>; bun run lint
cd <project-root>; bun run bench # if applicable
Monorepo packages:
cd <workspace-root>/packages/<package-name>; npm test
Always use the EXACT commands from the audit-process file. Never guess.
.agents/worktrees/audit-${timestamp} to avoid conflicts with the gitignored .agents/audit/ directory..agents/audit/ directory (gitignored) and are NOT committed with audit changes.