chore: update .gitignore and improve coding standards documentation

- Added .cursor/sessions/* to .gitignore to prevent session files from being tracked.
- Enhanced coding standards in SKILL.md by adding semicolons to TypeScript examples for consistency.
- Improved formatting in continuous learning, detail layout, and other SKILL.md files for better readability.

These changes aim to streamline development processes and maintain code quality across the project.
This commit is contained in:
shancheas
2026-08-25 17:50:17 +07:00
parent ff6814d038
commit f2f0be111a
48 changed files with 962 additions and 742 deletions
+3
View File
@@ -5,16 +5,19 @@ Incrementally fix TypeScript and build errors:
1. Run `pnpm typecheck` or `pnpm build` (this repo uses pnpm + Turbo + Vite)
2. Parse error output:
- Group by file
- Sort by severity
3. For each error:
- Show 5 lines of context
- Explain the issue
- Apply a minimal fix
- Re-run the failing command
4. Stop if:
- The fix introduces new errors
- The same error persists after 3 attempts
- The user asks to pause
+4
View File
@@ -26,12 +26,14 @@ When verifying against a checkpoint:
1. Read checkpoint from log
2. Compare current state to checkpoint:
- Files added since checkpoint
- Files modified since checkpoint
- Test pass rate now vs then
- Coverage now vs then
3. Report:
```
CHECKPOINT COMPARISON: $NAME
============================
@@ -44,6 +46,7 @@ Build: [PASS/FAIL]
## List Checkpoints
Show all checkpoints with:
- Name
- Timestamp
- Git SHA
@@ -68,6 +71,7 @@ Typical checkpoint flow:
## Arguments
$ARGUMENTS:
- `create <name>` - Create named checkpoint
- `verify <name>` - Verify against named checkpoint
- `list` - Show all checkpoints
+5 -1
View File
@@ -7,14 +7,16 @@ Comprehensive security and quality review of uncommitted changes:
2. For each changed file, check for:
**Security Issues (CRITICAL):**
- Hardcoded credentials, API keys, tokens
- SQL injection vulnerabilities
- XSS vulnerabilities
- XSS vulnerabilities
- Missing input validation
- Insecure dependencies
- Path traversal risks
**Code Quality (HIGH):**
- Functions > 50 lines
- Files > 800 lines
- Nesting depth > 4 levels
@@ -24,12 +26,14 @@ Comprehensive security and quality review of uncommitted changes:
- Missing JSDoc for public APIs
**Best Practices (MEDIUM):**
- Mutation patterns (use immutable instead)
- Emoji usage in code/comments
- Missing tests for new code
- Accessibility issues (a11y)
3. Generate report with:
- Severity: CRITICAL, HIGH, MEDIUM, LOW
- File location and line numbers
- Issue description
+5
View File
@@ -16,17 +16,21 @@ Create a new eval definition:
```markdown
## EVAL: feature-name
Created: $(date)
### Capability Evals
- [ ] [Description of capability 1]
- [ ] [Description of capability 2]
### Regression Evals
- [ ] [Existing behavior 1 still works]
- [ ] [Existing behavior 2 still works]
### Success Criteria
- pass@3 > 90% for capability evals
- pass^3 = 100% for regression evals
```
@@ -113,6 +117,7 @@ feature-export [0/4 passing] NOT STARTED
## Arguments
$ARGUMENTS:
- `define <name>` - Create new eval definition
- `check <name>` - Run and check evals
- `report <name>` - Generate full report
+7
View File
@@ -11,17 +11,20 @@ Run `/learn` at any point during a session when you've solved a non-trivial prob
Look for:
1. **Error Resolution Patterns**
- What error occurred?
- What was the root cause?
- What fixed it?
- Is this reusable for similar errors?
2. **Debugging Techniques**
- Non-obvious debugging steps
- Tool combinations that worked
- Diagnostic patterns
3. **Workarounds**
- Library quirks
- API limitations
- Version-specific fixes
@@ -42,15 +45,19 @@ Create a skill file at `.agents/skills/learned/[pattern-name].md`:
**Context:** [Brief description of when this applies]
## Problem
[What problem this solves - be specific]
## Solution
[The pattern/technique/workaround]
## Example
[Code example if applicable]
## When to Use
[Trigger conditions - what should activate this skill]
```
+20
View File
@@ -9,25 +9,33 @@ Sequential agent workflow for complex tasks.
## Workflow Types
### feature
Full feature implementation workflow:
```
planner -> tdd-guide -> code-reviewer -> security-reviewer
```
### bugfix
Bug investigation and fix workflow:
```
explorer -> tdd-guide -> code-reviewer
```
### refactor
Safe refactoring workflow:
```
architect -> code-reviewer -> tdd-guide
```
### security
Security-focused review:
```
security-reviewer -> code-reviewer -> architect
```
@@ -49,18 +57,23 @@ Between agents, create handoff document:
## HANDOFF: [previous-agent] -> [next-agent]
### Context
[Summary of what was done]
### Findings
[Key discoveries or decisions]
### Files Modified
[List of files touched]
### Open Questions
[Unresolved items for next agent]
### Recommendations
[Suggested next steps]
```
@@ -73,18 +86,21 @@ Between agents, create handoff document:
Executes:
1. **Planner Agent**
- Analyzes requirements
- Creates implementation plan
- Identifies dependencies
- Output: `HANDOFF: planner -> tdd-guide`
2. **TDD Guide Agent**
- Reads planner handoff
- Writes tests first
- Implements to pass tests
- Output: `HANDOFF: tdd-guide -> code-reviewer`
3. **Code Reviewer Agent**
- Reviews implementation
- Checks for issues
- Suggests improvements
@@ -139,18 +155,22 @@ For independent checks, run agents in parallel:
```markdown
### Parallel Phase
Run simultaneously:
- code-reviewer (quality)
- security-reviewer (security)
- architect (design)
### Merge Results
Combine outputs into single report
```
## Arguments
$ARGUMENTS:
- `feature <description>` - Full feature workflow
- `bugfix <description>` - Bug fix workflow
- `refactor <description>` - Refactoring workflow
+3
View File
@@ -16,6 +16,7 @@ This command invokes the **planner** agent to create a comprehensive implementat
## When to Use
Use `/plan` when:
- Starting a new feature
- Making significant architectural changes
- Working on complex refactoring
@@ -82,6 +83,7 @@ Agent (planner):
**CRITICAL**: The planner agent will **NOT** write any code until you explicitly confirm the plan with "yes" or "proceed" or similar affirmative response.
If you want changes, respond with:
- "modify: [your changes]"
- "different approach: [alternative]"
- "skip phase 2 and do phase 3 first"
@@ -89,6 +91,7 @@ If you want changes, respond with:
## Integration with Other Commands
After planning:
- Use `/tdd` to implement with test-driven development
- Use `/build-and-fix` if build errors occur
- Use `/code-review` to review completed implementation
+3
View File
@@ -3,6 +3,7 @@
Safely identify and remove dead code with test verification:
1. Run dead code analysis tools:
- knip: Find unused exports and files
- depcheck: Find unused dependencies
- ts-prune: Find unused TypeScript exports
@@ -10,6 +11,7 @@ Safely identify and remove dead code with test verification:
2. Generate comprehensive report in .reports/dead-code-analysis.md
3. Categorize findings by severity:
- SAFE: Test files, unused utilities
- CAUTION: API routes, components
- DANGER: Config files, main entry points
@@ -17,6 +19,7 @@ Safely identify and remove dead code with test verification:
4. Propose safe deletions only
5. Before each deletion:
- Run full test suite
- Verify tests pass
- Apply change
+3
View File
@@ -37,6 +37,7 @@ When determining which package manager to use, the following order is checked:
## Configuration Files
### Global Configuration
```json
// ~/.cursor/package-manager.json
{
@@ -45,6 +46,7 @@ When determining which package manager to use, the following order is checked:
```
### Project Configuration
```json
// .cursor/package-manager.json
{
@@ -53,6 +55,7 @@ When determining which package manager to use, the following order is checked:
```
### package.json
```json
{
"packageManager": "pnpm@8.6.0"
+4 -4
View File
@@ -34,12 +34,12 @@ User: /tdd Add validation for the full-page name field
```typescript
// full-page.validator.test.ts
import { createFullPageSchema } from './full-page.validator'
import { createFullPageSchema } from './full-page.validator';
it('rejects an empty name', () => {
const schema = createFullPageSchema((k) => k)
expect(schema.safeParse({ code: 'ABC', name: '' }).success).toBe(false)
})
const schema = createFullPageSchema((k) => k);
expect(schema.safeParse({ code: 'ABC', name: '' }).success).toBe(false);
});
```
```bash
+2
View File
@@ -7,6 +7,7 @@ Analyze Vitest coverage and add missing tests:
2. Identify files below 80%
3. For each under-covered file:
- Unit tests for validators, transformers, utils, stores
- Testing Library tests for `@repo/ui` components
- Journey tests for critical `apps/web` flows (mock data services)
@@ -16,6 +17,7 @@ Analyze Vitest coverage and add missing tests:
5. Show before/after coverage
Focus on:
- Happy path
- Error handling
- Edge cases (null, undefined, empty)
+3
View File
@@ -3,12 +3,15 @@
Sync docs with this frontend monorepo. Source of truth: `package.json`, `apps/web/.env.example`, and `apps/docs-dev` (VitePress).
1. Read root `package.json` scripts
- Table of `pnpm dev:web`, `pnpm dev:showcase`, `pnpm dev:docs-dev`, `pnpm typecheck:web`, `pnpm test`, `pnpm check:all`
2. Read `apps/web/.env.example`
- Document each `VITE_*` var (they are public to the client)
3. Update `apps/docs-dev` (VitePress) and the root README
- Where to work (`apps/web` vs `showcase`)
- Module layout (`example/full-page`)
- Preferred `@repo/*` imports
+6
View File
@@ -7,23 +7,28 @@ Run comprehensive verification on current codebase state.
Execute verification in this exact order:
1. **Build Check**
- Run the build command for this project
- If it fails, report errors and STOP
2. **Type Check**
- Run TypeScript/type checker
- Report all errors with file:line
3. **Lint Check**
- Run linter
- Report warnings and errors
4. **Test Suite**
- Run all tests
- Report pass/fail count
- Report coverage percentage
5. **Console.log Audit**
- Search for console.log in source files
- Report locations
@@ -53,6 +58,7 @@ If any critical issues, list them with fix suggestions.
## Arguments
$ARGUMENTS can be:
- `quick` - Only build + types
- `full` - All checks (default)
- `pre-commit` - Checks relevant for commits