finish-work
Finish Work - Pre-Commit Checklist
Before submitting or committing, use this checklist to ensure work completeness.
Timing: After code is written and tested, before commit
Checklist
1. Code Quality
# Must pass
pnpm lint
pnpm type-check
pnpm test
-
pnpm lintpasses with 0 errors? -
pnpm type-checkpasses with no type errors? - Tests pass?
- No
console.logstatements (use logger)? - No non-null assertions (the
x!operator)? - No
anytypes?
2. Code-Spec Sync
Code-Spec Docs:
- Does
.trellis/spec/backend/need updates?- New patterns, new modules, new conventions
- Does
.trellis/spec/frontend/need updates?- New components, new hooks, new patterns
- Does
.trellis/spec/guides/need updates?- New cross-layer flows, lessons from bugs
Key Question:
"If I fixed a bug or discovered something non-obvious, should I document it so future me (or others) won't hit the same issue?"
If YES -> Update the relevant code-spec doc.
2.5. Code-Spec Hard Block (Infra/Cross-Layer)
If this change touches infra or cross-layer contracts, this is a blocking checklist:
- Spec content is executable (real signatures/contracts), not principle-only text
- Includes file path + command/API name + payload field names
- Includes validation and error matrix
- Includes Good/Base/Bad cases
- Includes required tests and assertion points
Block Rule:
If infra/cross-layer changed but the related spec is still abstract, do NOT finish. Run $update-spec manually first.
3. API Changes
If you modified API endpoints:
- Input schema updated?
- Output schema updated?
- API documentation updated?
- Client code updated to match?
4. Database Changes
If you modified database schema:
- Migration file created?
- Schema file updated?
- Related queries updated?
- Seed data updated (if applicable)?
5. Cross-Layer Verification
If the change spans multiple layers:
- Data flows correctly through all layers?
- Error handling works at each boundary?
- Types are consistent across layers?
- Loading states handled?
6. Manual Testing
- Feature works in browser/app?
- Edge cases tested?
- Error states tested?
- Works after page refresh?
Quick Check Flow
# 1. Code checks
pnpm lint && pnpm type-check
# 2. View changes
git status
git diff --name-only
# 3. Based on changed files, check relevant items above
Common Oversights
| Oversight | Consequence | Check |
|---|---|---|
| Code-spec docs not updated | Others don't know the change | Check .trellis/spec/ |
| Spec text is abstract only | Easy regressions in infra/cross-layer changes | Require signature/contract/matrix/cases/tests |
| Migration not created | Schema out of sync | Check db/migrations/ |
| Types not synced | Runtime errors | Check shared types |
| Tests not updated | False confidence | Run full test suite |
| Console.log left in | Noisy production logs | Search for console.log |
Relationship to Other Commands
Development Flow:
Write code -> Test -> $finish-work -> git commit -> $record-session
| |
Ensure completeness Record progress
Debug Flow:
Hit bug -> Fix -> $break-loop -> Knowledge capture
|
Deep analysis
$finish-work- Check work completeness (this skill)$record-session- Record session and commits$break-loop- Deep analysis after debugging
Core Principle
Delivery includes not just code, but also documentation, verification, and knowledge capture.
Complete work = Code + Docs + Tests + Verification
More from mindfold-ai/trellis
trellis-meta
Understand and customize the local Trellis architecture inside a user project. Use when modifying .trellis plus platform hooks, settings, agents, skills, commands, prompts, or workflows generated by trellis init.
166cc-codex-spec-bootstrap
Claude Code + Codex parallel pipeline for bootstrapping Trellis coding specs. CC analyzes the repo with GitNexus (knowledge graph) + ABCoder (AST), creates Trellis task PRDs with full architectural context and MCP tool instructions, then Codex agents run those tasks in parallel to fill spec files. Use when: bootstrapping coding guidelines, setting up Trellis specs, 'bootstrap specs for codex', 'create spec tasks', 'CC + Codex spec pipeline', 'initialize coding guidelines with code intelligence'. Also triggers when user wants to set up GitNexus or ABCoder MCP for multi-agent spec generation.
89brainstorm
Collaborative requirements discovery session optimized for AI coding workflows. Creates task directories, seeds PRDs, runs codebase research, proposes concrete implementation approaches with trade-offs, and converges on MVP scope through structured Q&A. Use when requirements are unclear, multiple implementation paths exist, trade-offs need evaluation, or a complex feature needs scoping before development.
38break-loop
Deep post-fix bug analysis across five dimensions: root cause categorization, fix failure analysis, prevention mechanisms, systematic expansion, and knowledge capture. Updates .trellis/spec/ guides with lessons learned to prevent recurring bugs. Use when a debugging session completes, after fixing a tricky bug, when the same class of bug keeps recurring, or when you want to capture debugging insights into project documentation.
34record-session
Records completed work progress to .trellis/workspace/ journal files after human testing and commit. Captures session summaries, commit hashes, and updates developer index files for future session context. Use when a coding session is complete, after the human has committed code, or to persist session knowledge for future AI sessions.
32start
Initializes an AI development session by reading workflow guides, developer identity, git status, active tasks, and project guidelines from .trellis/. Classifies incoming tasks and routes to brainstorm, direct edit, or task workflow. Use when beginning a new coding session, resuming work, starting a new task, or re-establishing project context.
30