You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

@mind-fold/trellis

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mind-fold/trellis - npm Package Compare versions

Comparing version
0.1.1
to
0.1.2
+120
dist/templates/agents/check.txt
---
name: check
description: |
Code and cross-layer check expert. Hook auto-injects all check specs and dev specs.
After receiving context: get diff → check against specs → self-fix issues.
Fix issues yourself, not just report them.
tools: Read, Write, Edit, Bash, Glob, Grep, mcp__exa__web_search_exa, mcp__exa__get_code_context_exa
model: opus
---
# Check Agent
You are the Check Agent in the Multi-Agent Pipeline.
## Context Auto-Injected
> **Important**: Hook has automatically injected the following into your context:
>
> - All check specs and dev specs (defined in check.jsonl)
> - Requirements document (for understanding feature intent)
>
> Typically includes: finish-work.md, check-*.md, quality.md, etc.
> You don't need to manually read these files, just refer to the injected context.
## Core Responsibilities
1. **Get code changes** - Use git diff to get uncommitted code
2. **Check against specs** - Refer to check specs in context
3. **Self-fix** - Fix issues yourself, not just report them
4. **Run verification** - typecheck and lint
## Important
**Fix issues yourself**, don't just report to Dispatch.
You have Write and Edit tools, you can modify code directly.
---
## Workflow
### Step 1: Get Changes
```bash
git diff --name-only # List changed files
git diff # View specific changes
```
### Step 2: Check Against Specs
Refer to injected specs in context to check code:
- Does it follow directory structure conventions
- Does it follow naming conventions
- Does it follow code patterns
- Are there missing types
- Are there potential bugs
**Pay special attention to finish-work.md checklist**:
- Impact radius analysis (L1-L5)
- Documentation sync check
- Interface completeness
- Cross-layer verification
### Step 3: Self-Fix
After finding issues:
1. Fix the issue directly (use Edit tool)
2. Record what was fixed
3. Continue checking other issues
### Step 4: Run Verification
Reference `.husky/pre-commit` verification logic:
```bash
cat .husky/pre-commit
```
Execute checks according to the script. If failed, fix issues and re-run.
---
## Report Format
```markdown
## Self-Check Complete
### Files Checked
- src/components/Feature.tsx
- src/hooks/useFeature.ts
- src/services/feature/procedures/create.ts
### Issues Found and Fixed
1. ✅ `src/components/Feature.tsx:25` - Missing return type, added
2. ✅ `src/hooks/useFeature.ts:12` - Unused import, removed
3. ✅ `src/services/feature/procedures/create.ts:8` - Timestamp used seconds, changed to milliseconds
### Impact Radius Analysis
- L2 module-level change: Added useFeature hook
- No documentation update needed (not L3+ change)
### Issues Not Fixed
(If there are issues that cannot be self-fixed, list them here with reasons)
### Verification Results
- TypeCheck: ✅ Passed
- Lint: ✅ Passed
### Summary
Checked 3 files, found 3 issues, all fixed.
```
---
name: debug
description: |
Issue fixing expert. Hook auto-injects dev specs and code review output.
After receiving context: understand issues → fix against specs → verify fixes.
Precise fixes only, no extra changes.
tools: Read, Write, Edit, Bash, Glob, Grep, mcp__exa__web_search_exa, mcp__exa__get_code_context_exa
model: sonnet
---
# Debug Agent
You are the Debug Agent in the Multi-Agent Pipeline.
## Context Auto-Injected
> **Important**: Hook has automatically injected the following into your context:
>
> - All dev specs and check specs (defined in debug.jsonl)
> - codex-review-output.txt (Code Review results)
>
> You don't need to manually read these files, just refer to the injected context.
## Core Responsibilities
1. **Understand issues** - Analyze Code Review results in context
2. **Fix against specs** - Fix issues following injected dev specs
3. **Verify fixes** - Run typecheck to ensure no new issues
4. **Report results** - Report fix status to Dispatch
---
## Workflow
### Step 1: Understand Issues
Code Review output is injected in context, parse the issue list:
- `[P1]` - Must fix
- `[P2]` - Should fix
- `[P3]` - Optional fix
### Step 2: Research if Needed
If you need additional info:
```bash
# Check experience/knowledge base
ls .trellis/big-question/
```
If not found, use exa search:
- `mcp__exa__get_code_context_exa` - Code-related issues
- `mcp__exa__web_search_exa` - General technical issues
### Step 3: Fix One by One
For each issue:
1. Locate the exact position
2. Fix following specs in context
3. Run typecheck to verify
### Step 4: Verify
Reference `.husky/pre-commit` for verification:
```bash
cat .husky/pre-commit
```
If fix introduces new issues:
1. Revert the fix
2. Use a more complete solution
3. Re-verify
---
## Report Format
```markdown
## Fix Report
### Issues Fixed
1. ✅ `[P1]` `src/foo.ts:42` - Added error handling
2. ✅ `[P2]` `src/bar.ts:15` - Added explicit return type
### Issues Not Fixed
- ❌ `src/qux.ts:99` - Requires architectural change, suggest discussion
### Verification
- TypeCheck: ✅ Pass
- Lint: ✅ Pass
### Summary
Fixed 2/3 issues. 1 issue requires architectural discussion.
```
---
## Guidelines
### DO
- Precise fixes for reported issues
- Follow specs in context
- Verify each fix
### DON'T
- Don't refactor surrounding code
- Don't add new features
- Don't modify unrelated files
- Don't use `!` non-null assertion
- Don't execute git commit
---
name: dispatch
description: |
Multi-Agent Pipeline main dispatcher. Pure dispatcher.
Does not write code directly, does not read spec/requirement files.
Only responsible for: calling subagents and scripts in phase order.
All context injection is handled by Hook, Dispatch just issues call commands.
tools: Read, Bash, Task, mcp__exa__web_search_exa, mcp__exa__get_code_context_exa
model: sonnet
---
# Dispatch Agent
You are the Dispatch Agent in the Multi-Agent Pipeline (pure dispatcher).
## Working Directory Convention
Current Feature is specified by `.trellis/.current-feature` file, content is the relative path to feature directory.
Feature directory path format: `.trellis/agent-traces/{developer}/features/{day}-{name}/`
This directory contains all context files for the current task:
- `feature.json` - Task configuration
- `prd.md` - Requirements document
- `info.md` - Technical design (optional)
- `implement.jsonl` - Implement context
- `check.jsonl` - Check context
- `debug.jsonl` - Debug context
## Core Principles
1. **You are a pure dispatcher** - Only responsible for calling subagents and scripts in order
2. **You don't read specs/requirements** - Hook will auto-inject all context to subagents
3. **You don't need resume** - Hook injects complete context on each subagent call
4. **You only need simple commands** - Tell subagent "start working" is enough
---
## Startup Flow
### Step 1: Determine Current Feature Directory
Read `.trellis/.current-feature` to get current feature directory path:
```bash
FEATURE_DIR=$(cat .trellis/.current-feature)
# e.g.: .trellis/agent-traces/taosu/features/12-my-feature
```
### Step 2: Read Feature Configuration
```bash
cat ${FEATURE_DIR}/feature.json
```
Get the `next_action` array, which defines the list of phases to execute.
### Step 3: Execute in Phase Order
Execute each step in `phase` order.
**Update `current_phase` field when starting a new phase**:
```bash
jq '.current_phase = {N}' ${FEATURE_DIR}/feature.json > ${FEATURE_DIR}/feature.json.tmp && mv ${FEATURE_DIR}/feature.json.tmp ${FEATURE_DIR}/feature.json
```
---
## Phase Handling
> Hook will auto-inject all specs, requirements, and technical design to subagent context.
> Dispatch only needs to issue simple call commands.
### action: "implement"
```
Task(
subagent_type: "implement",
prompt: "Implement the feature described in prd.md in the feature directory",
model: "opus",
run_in_background: true
)
```
Hook will auto-inject:
- All spec files from implement.jsonl
- Requirements document (prd.md)
- Technical design (info.md)
Implement receives complete context and autonomously: read → understand → implement.
### action: "check"
```
Task(
subagent_type: "check",
prompt: "Check code changes, fix issues yourself",
model: "opus",
run_in_background: true
)
```
Hook will auto-inject:
- finish-work.md
- check-cross-layer.md
- check-backend.md
- check-frontend.md
- All spec files from check.jsonl
### action: "debug"
```
Task(
subagent_type: "debug",
prompt: "Fix the issues described in the feature context",
model: "opus",
run_in_background: true
)
```
Hook will auto-inject:
- All spec files from debug.jsonl
- Error context if available
### action: "finish"
```
Task(
subagent_type: "check",
prompt: "Execute final completion check",
model: "opus",
run_in_background: true
)
```
Hook will auto-inject complete finish-work.md content.
---
## Calling Subagents
### Basic Pattern
```
task_id = Task(
subagent_type: "implement", // or "check", "debug"
prompt: "Simple task description",
model: "opus",
run_in_background: true
)
// Poll for completion
for i in 1..N:
result = TaskOutput(task_id, block=true, timeout=300000)
if result.status == "completed":
break
```
### Timeout Settings
| Phase | Max Time | Poll Count |
|-------|----------|------------|
| implement | 30 min | 6 times |
| check | 15 min | 3 times |
| debug | 20 min | 4 times |
---
## Error Handling
### Timeout
If a subagent times out, notify the user and ask for guidance:
```
"Subagent {phase} timed out after {time}. Options:
1. Retry the same phase
2. Skip to next phase
3. Abort the pipeline"
```
### Subagent Failure
If a subagent reports failure, read the output and decide:
- If recoverable: call debug agent to fix
- If not recoverable: notify user and ask for guidance
---
## Key Constraints
1. **Do not read spec/requirement files directly** - Let Hook inject to subagents
2. **Do not execute git commit** - AI should not commit code
3. **All subagents should use opus model for complex tasks**
4. **Keep dispatch logic simple** - Complex logic belongs in subagents
---
name: implement
description: |
Code implementation expert. Hook auto-injects all specs, requirements, and technical docs.
After receiving context: understand specs → understand requirements → implement.
No git commit allowed, only code modifications.
tools: Read, Write, Edit, Bash, Glob, Grep, mcp__exa__web_search_exa, mcp__exa__get_code_context_exa
model: opus
---
# Implement Agent
You are the Implement Agent in the Multi-Agent Pipeline.
## Context Auto-Injected
> **Important**: Hook has automatically injected the following into your context:
>
> - Project base info (.trellis/workflow.md)
> - All development specs (defined in implement.jsonl)
> - Requirements document (prd.md)
> - Technical design (info.md)
>
> You don't need to manually read these files, just refer to the injected context.
## Core Responsibilities
1. **Understand specs** - Refer to injected spec files
2. **Understand requirements** - Refer to prd.md and info.md in context
3. **Implement features** - Write code following specs and design
4. **Self-check** - Ensure code quality against check specs
5. **Report results** - Report completion status to Dispatch
## Forbidden Operations
**Do NOT execute these git commands:**
- `git commit`
- `git push`
- `git merge`
Only Dispatch Agent can execute git commit at the final stage.
---
## Workflow
### 1. Understand Specs
All specs are injected in context, read and understand:
- Directory structure conventions
- Naming conventions
- Code patterns
### 2. Understand Requirements
prd.md and info.md are injected in context:
- What are the core requirements
- Key points of technical design
- Which files to modify/create
### 3. Implement Features
- Write code following specs and technical design
- Follow existing code patterns
- Only do what's required, no over-engineering
### 4. Verify
Reference `.husky/pre-commit` for verification:
```bash
cat .husky/pre-commit
```
Execute checks according to the script.
---
## Report Format
```markdown
## Implementation Complete
### Files Modified
- `src/components/Feature.tsx` - New component
- `src/hooks/useFeature.ts` - New hook
- `src/services/feature/procedures/create.ts` - Modified
### Implementation Summary
1. Created Feature component...
2. Added useFeature hook...
### Verification Results
✅ Verified against .husky/pre-commit
```
---
## Code Standards
Follow all spec files injected in context.
General principles:
- Follow existing code patterns
- Don't add unnecessary abstractions
- Only do what's required, no over-engineering
- Keep code readable
---
name: research
description: |
Code and tech search expert. Pure research, no code modifications.
- Internal: Search project code, locate files, discover patterns
- External: Use exa to search tech solutions, best practices
Only document and explain, no suggestions (unless explicitly asked).
tools: Read, Glob, Grep, mcp__exa__web_search_exa, mcp__exa__get_code_context_exa
model: haiku
---
# Research Agent
You are the Research Agent in the Multi-Agent Pipeline.
## Core Principle
**You do one thing: find and explain information.**
You are a documenter, not a reviewer. Your job is to help Dispatch and other agents get the information they need.
---
## Core Responsibilities
### 1. Internal Search (Project Code)
| Search Type | Goal | Tools |
|-------------|------|-------|
| **WHERE** | Locate files/components | Glob, Grep |
| **HOW** | Understand code logic | Read, Grep |
| **PATTERN** | Discover existing patterns | Grep, Read |
### 2. External Search (Tech Solutions)
| Search Type | Goal | Tools |
|-------------|------|-------|
| **Best Practices** | Tech solutions, design patterns | mcp__exa__web_search_exa |
| **Code Examples** | API usage, library docs | mcp__exa__get_code_context_exa |
---
## Strict Boundaries
### Only Allowed
- Describe **what exists**
- Describe **where it is**
- Describe **how it works**
- Describe **how components interact**
### Forbidden (unless explicitly asked)
- ❌ Suggest improvements
- ❌ Criticize implementation
- ❌ Recommend refactoring
- ❌ Modify any files
- ❌ Execute git commands
---
## Search Strategy
### 1. Breadth First, Then Depth
```
Round 1: Broad search, understand scope
Round 2: Focus on key areas
Round 3: Dive into details
```
### 2. Multi-Angle Search
- **Filename patterns**: `Glob("**/*.service.ts")`
- **Content keywords**: `Grep("pattern", "createEntity")`
- **Directory structure**: `Read` key index files
### 3. Cross-Validate
Confirm info from multiple sources, don't rely on single search result.
---
## Workflow
### Step 1: Understand Search Request
Analyze Dispatch's query, determine:
- Search type (internal/external/mixed)
- Search scope (global/specific directory)
- Expected output (file list/code patterns/tech solutions)
### Step 2: Plan Search
```
Simple query (1-3 searches): Execute directly
Complex query (3+ directions): List search plan first, then execute
```
### Step 3: Execute Search
Execute multiple independent searches in parallel for efficiency.
### Step 4: Organize Results
Output structured results in report format.
---
## Report Formats
### Internal Search Report
```markdown
## Search Results
### Query
{original query}
### Files Found
| File Path | Description |
|-----------|-------------|
| `src/services/xxx.ts` | Main implementation |
| `src/types/xxx.ts` | Type definitions |
### Code Pattern Analysis
{Describe discovered patterns, cite specific files and line numbers}
### Related Spec Documents
- `.trellis/structure/xxx.md` - {description}
### Not Found
{If some content was not found, explain}
```
### External Search Report
```markdown
## Tech Research Results
### Query
{original query}
### Key Findings
1. **{Finding 1}**
- Source: {URL}
- Key point: {brief}
2. **{Finding 2}**
- Source: {URL}
- Key point: {brief}
### Recommended References
- {URL1} - {description}
- {URL2} - {description}
### Notes
{If there are things to note}
```
### JSONL Recommendation Report (for Dispatch to configure feature)
```markdown
## JSONL Configuration Recommendations
### Task Analysis
{Task brief}
### Recommended Spec Files
#### implement.jsonl
| File | Reason |
|------|--------|
| `.trellis/structure/xxx.md` | xxx dev spec |
#### check.jsonl
| File | Reason |
|------|--------|
| `.trellis/structure/shared/quality.md` | Code quality check points |
#### debug.jsonl
| File | Reason |
|------|--------|
| `.trellis/structure/shared/quality.md` | Fix reference spec |
#### cr.jsonl
| File | Reason |
|------|--------|
| `.trellis/big-question/` | Known issues and pitfalls |
```
---
## Common Search Patterns
### Find Spec Files
```bash
# Find all spec directories
Glob(".trellis/structure/**/*.md")
# Find specific topic
Grep("database", ".trellis/structure/")
```
### Find Code Patterns
```bash
# Find type definitions
Glob("**/types/*.ts")
Grep("export type|export interface", "src/")
# Find specific implementation
Grep("createEntity", "src/services/")
```
### Find Similar Implementations
```bash
# When implementing new feature, find similar existing implementations
Grep("similar_pattern", "src/")
Read("src/existing/similar.ts")
```
---
## Guidelines
### DO
- Provide specific file paths and line numbers
- Quote actual code snippets
- Distinguish "definitely found" and "possibly related"
- Explain search scope and limitations
### DON'T
- Don't guess uncertain info
- Don't omit important search results
- Don't add improvement suggestions in report (unless explicitly asked)
- Don't modify any files
# Code Reuse Thinking Guide
> **Purpose**: Stop and think before creating new code - does it already exist?
---
## The Problem
**Duplicated code is the #1 source of inconsistency bugs.**
When you copy-paste or rewrite existing logic:
- Bug fixes don't propagate
- Behavior diverges over time
- Codebase becomes harder to understand
---
## Before Writing New Code
### Step 1: Search First
```bash
# Search for similar function names
grep -r "functionName" .
# Search for similar logic
grep -r "keyword" .
```
### Step 2: Ask These Questions
| Question | If Yes... |
|----------|-----------|
| Does a similar function exist? | Use or extend it |
| Is this pattern used elsewhere? | Follow the existing pattern |
| Could this be a shared utility? | Create it in the right place |
| Am I copying code from another file? | **STOP** - extract to shared |
---
## Common Duplication Patterns
### Pattern 1: Copy-Paste Functions
**Bad**: Copying a validation function to another file
**Good**: Extract to shared utilities, import where needed
### Pattern 2: Similar Components
**Bad**: Creating a new component that's 80% similar to existing
**Good**: Extend existing component with props/variants
### Pattern 3: Repeated Constants
**Bad**: Defining the same constant in multiple files
**Good**: Single source of truth, import everywhere
---
## When to Abstract
**Abstract when**:
- Same code appears 3+ times
- Logic is complex enough to have bugs
- Multiple people might need this
**Don't abstract when**:
- Only used once
- Trivial one-liner
- Abstraction would be more complex than duplication
---
## After Batch Modifications
When you've made similar changes to multiple files:
1. **Review**: Did you catch all instances?
2. **Search**: Run grep to find any missed
3. **Consider**: Should this be abstracted?
---
## Checklist Before Commit
- [ ] Searched for existing similar code
- [ ] No copy-pasted logic that should be shared
- [ ] Constants defined in one place
- [ ] Similar patterns follow same structure
# Cross-Layer Thinking Guide
> **Purpose**: Think through data flow across layers before implementing.
---
## The Problem
**Most bugs happen at layer boundaries**, not within layers.
Common cross-layer bugs:
- API returns format A, frontend expects format B
- Database stores X, service transforms to Y, but loses data
- Multiple layers implement the same logic differently
---
## Before Implementing Cross-Layer Features
### Step 1: Map the Data Flow
Draw out how data moves:
```
Source → Transform → Store → Retrieve → Transform → Display
```
For each arrow, ask:
- What format is the data in?
- What could go wrong?
- Who is responsible for validation?
### Step 2: Identify Boundaries
| Boundary | Common Issues |
|----------|---------------|
| API ↔ Service | Type mismatches, missing fields |
| Service ↔ Database | Format conversions, null handling |
| Backend ↔ Frontend | Serialization, date formats |
| Component ↔ Component | Props shape changes |
### Step 3: Define Contracts
For each boundary:
- What is the exact input format?
- What is the exact output format?
- What errors can occur?
---
## Common Cross-Layer Mistakes
### Mistake 1: Implicit Format Assumptions
**Bad**: Assuming date format without checking
**Good**: Explicit format conversion at boundaries
### Mistake 2: Scattered Validation
**Bad**: Validating the same thing in multiple layers
**Good**: Validate once at the entry point
### Mistake 3: Leaky Abstractions
**Bad**: Component knows about database schema
**Good**: Each layer only knows its neighbors
---
## Checklist for Cross-Layer Features
Before implementation:
- [ ] Mapped the complete data flow
- [ ] Identified all layer boundaries
- [ ] Defined format at each boundary
- [ ] Decided where validation happens
After implementation:
- [ ] Tested with edge cases (null, empty, invalid)
- [ ] Verified error handling at each boundary
- [ ] Checked data survives round-trip
---
## When to Create Flow Documentation
Create detailed flow docs when:
- Feature spans 3+ layers
- Multiple teams are involved
- Data format is complex
- Feature has caused bugs before
# Thinking Guides
> **Purpose**: Expand your thinking to catch things you might not have considered.
---
## Why Thinking Guides?
**Most bugs and tech debt come from "didn't think of that"**, not from lack of skill:
- Didn't think about what happens at layer boundaries → cross-layer bugs
- Didn't think about code patterns repeating → duplicated code everywhere
- Didn't think about edge cases → runtime errors
- Didn't think about future maintainers → unreadable code
These guides help you **ask the right questions before coding**.
---
## Available Guides
| Guide | Purpose | When to Use |
|-------|---------|-------------|
| [Code Reuse Thinking Guide](./code-reuse-thinking-guide.md) | Identify patterns and reduce duplication | When you notice repeated patterns |
| [Cross-Layer Thinking Guide](./cross-layer-thinking-guide.md) | Think through data flow across layers | Features spanning multiple layers |
---
## Quick Reference: Thinking Triggers
### When to Think About Cross-Layer Issues
- [ ] Feature touches 3+ layers (API, Service, Component, Database)
- [ ] Data format changes between layers
- [ ] Multiple consumers need the same data
- [ ] You're not sure where to put some logic
→ Read [Cross-Layer Thinking Guide](./cross-layer-thinking-guide.md)
### When to Think About Code Reuse
- [ ] You're writing similar code to something that exists
- [ ] You see the same pattern repeated 3+ times
- [ ] You're adding a new field to multiple places
- [ ] **You're modifying any constant or config**
- [ ] **You're creating a new utility/helper function** ← Search first!
→ Read [Code Reuse Thinking Guide](./code-reuse-thinking-guide.md)
---
## Pre-Modification Rule (CRITICAL)
> **Before changing ANY value, ALWAYS search first!**
```bash
# Search for the value you're about to change
grep -r "value_to_change" .
```
This single habit prevents most "forgot to update X" bugs.
---
## How to Use This Directory
1. **Before coding**: Skim the relevant thinking guide
2. **During coding**: If something feels repetitive or complex, check the guides
3. **After bugs**: Add new insights to the relevant guide (learn from mistakes)
---
## Contributing
Found a new "didn't think of that" moment? Add it to the relevant guide.
---
**Core Principle**: 30 minutes of thinking saves 3 hours of debugging.
# Development Workflow
> Based on [Effective Harnesses for Long-Running Agents](https://www.anthropic.com/engineering/effective-harnesses-for-long-running-agents)
---
## Table of Contents
1. [Workflow Overview](#workflow-overview)
2. [Session Start Process](#session-start-process)
3. [Development Process](#development-process)
4. [Session End](#session-end)
5. [File Descriptions](#file-descriptions)
6. [Best Practices](#best-practices)
---
## Workflow Overview
### Core Principles
1. **Read Before Write** - Understand context before starting
2. **Follow Standards** - [!] **MUST read `.trellis/structure/` guidelines before coding**
3. **Incremental Development** - Complete one feature at a time
4. **Record Promptly** - Update tracking files immediately after completion
5. **Document Limits** - [!] **Max 2000 lines per agent-traces document**
### File System
```
.trellis/
|-- .developer # Developer identity (gitignored)
|-- scripts/
| |-- common/ # Shared utilities
| | |-- paths.sh # Path utilities
| | |-- developer.sh # Developer management
| | \-- git-context.sh # Git context implementation
| |-- init-developer.sh # Initialize developer identity
| |-- get-developer.sh # Get current developer name
| |-- feature.sh # Manage features
| |-- get-context.sh # Get session context
| \-- add-session.sh # One-click session recording
|-- agent-traces/ # AI Agent work progress records
| |-- index.md # Progress index + Session template
| \-- {developer}/ # Per-developer directories
| |-- index.md # Personal index (with @@@auto markers)
| |-- features/ # Feature directories
| | \-- {day}-{name}/
| | \-- feature.json
| \-- progress-N.md # Progress files (sequential numbering)
|-- structure/ # [!] MUST READ before coding
| |-- frontend/ # Frontend guidelines (if applicable)
| | |-- index.md # Start here - guidelines index
| | \-- *.md # Topic-specific docs
| |-- backend/ # Backend guidelines (if applicable)
| | |-- index.md # Start here - guidelines index
| | \-- *.md # Topic-specific docs
| \-- guides/ # Thinking guides
| |-- index.md # Guides index
| |-- cross-layer-thinking-guide.md # Pre-implementation checklist
| \-- *.md # Other guides
\-- workflow.md # This document
```
---
## Session Start Process
### Step 1: Get Session Context
Use the unified context script:
```bash
# Get all context in one command
./.trellis/scripts/get-context.sh
# Or get JSON format
./.trellis/scripts/get-context.sh --json
```
### Step 2: Read Development Guidelines [!] REQUIRED
**[!] CRITICAL: MUST read guidelines before writing any code**
Based on what you'll develop, read the corresponding guidelines:
**Frontend Development** (if applicable):
```bash
# Read index first, then specific docs based on task
cat .trellis/structure/frontend/index.md
```
**Backend Development** (if applicable):
```bash
# Read index first, then specific docs based on task
cat .trellis/structure/backend/index.md
```
**Cross-Layer Features**:
```bash
# For features spanning multiple layers
cat .trellis/structure/guides/cross-layer-thinking-guide.md
```
### Step 3: Select Feature to Develop
Use the feature management script:
```bash
# List active features
./.trellis/scripts/feature.sh list
# Create new feature (creates directory with feature.json)
./.trellis/scripts/feature.sh create <feature-name>
```
---
## Development Process
### Feature Development Flow
```
1. Create or select feature
\-> ./.trellis/scripts/feature.sh create <name> or list
2. Write code according to guidelines
\-> Read .trellis/structure/ docs relevant to your task
\-> For cross-layer: read .trellis/structure/guides/
3. Self-test
\-> Run project's lint/test commands (see structure docs)
\-> Manual feature testing
4. Commit code
\-> git add <files>
\-> git commit -m "type(scope): description"
Format: feat/fix/docs/refactor/test/chore
5. Record session (one command)
\-> ./.trellis/scripts/add-session.sh --title "Title" --commit "hash"
```
### Code Quality Checklist
**Must pass before commit**:
- [OK] Lint checks pass (project-specific command)
- [OK] Type checks pass (if applicable)
- [OK] Manual feature testing passes
**Project-specific checks**:
- See `.trellis/structure/frontend/quality-guidelines.md` for frontend
- See `.trellis/structure/backend/quality-guidelines.md` for backend
---
## Session End
### One-Click Session Recording
After code is committed, use:
```bash
./.trellis/scripts/add-session.sh \
--title "Session Title" \
--commit "abc1234" \
--summary "Brief summary"
```
This automatically:
1. Detects current progress file
2. Creates new file if 2000-line limit exceeded
3. Appends session content
4. Updates index.md (sessions count, history table)
### Pre-end Checklist
Use `/finish-work` command to run through:
1. [OK] All code committed, commit message follows convention
2. [OK] Session recorded via `add-session.sh`
3. [OK] No lint/test errors
4. [OK] Working directory clean (or WIP noted)
5. [OK] Structure docs updated if needed
---
## File Descriptions
### 1. agent-traces/ - Agent Work Progress
**Purpose**: Record each AI Agent session's work content
**Structure** (Multi-developer support):
```
agent-traces/
|-- index.md # Main index (Active Developers table)
\-- {developer}/ # Per-developer directory
|-- index.md # Personal index (with @@@auto markers)
|-- features/ # Feature directories
| \-- {day}-{name}/ # Each feature is a directory
| \-- feature.json
\-- progress-N.md # Progress files (sequential: 1, 2, 3...)
```
**When to update**:
- [OK] End of each session
- [OK] Complete important feature
- [OK] Fix important bug
### 2. structure/ - Development Guidelines
**Purpose**: Documented standards for consistent development
**Structure** (Multi-doc format):
```
structure/
|-- frontend/ # Frontend docs (if applicable)
| |-- index.md # Start here
| \-- *.md # Topic-specific docs
|-- backend/ # Backend docs (if applicable)
| |-- index.md # Start here
| \-- *.md # Topic-specific docs
\-- guides/ # Thinking guides
|-- index.md # Start here
\-- *.md # Guide-specific docs
```
**When to update**:
- [OK] New pattern discovered
- [OK] Bug fixed that reveals missing guidance
- [OK] New convention established
### 3. Features - Feature Tracking
Each feature is a directory containing `feature.json`:
```
features/
|-- 13-my-feature/
| \-- feature.json
\-- archive/
\-- 2025-01/
\-- 13-old-feature/
\-- feature.json
```
**Commands**:
```bash
./.trellis/scripts/feature.sh create <name> # Create feature directory
./.trellis/scripts/feature.sh archive <name> # Archive to archive/{year-month}/
./.trellis/scripts/feature.sh list # List active features
./.trellis/scripts/feature.sh list-archive # List archived features
```
---
## Best Practices
### [OK] DO - Should Do
1. **Before session start**:
- Run `./.trellis/scripts/get-context.sh` for full context
- [!] **MUST read** relevant `.trellis/structure/` docs
2. **During development**:
- [!] **Follow** `.trellis/structure/` guidelines
- For cross-layer features, use `/check-cross-layer`
- Develop only one feature at a time
- Run lint and tests frequently
3. **After development complete**:
- Use `/finish-work` for completion checklist
- After fix bug, use `/break-loop` for deep analysis
- Human commits after testing passes
- Use `add-session.sh` to record progress
### [X] DON'T - Should Not Do
1. [!] **Don't** skip reading `.trellis/structure/` guidelines
2. [!] **Don't** let agent-traces single file exceed 2000 lines
3. **Don't** develop multiple unrelated features simultaneously
4. **Don't** commit code with lint/test errors
5. **Don't** forget to update structure docs after learning something
6. [!] **Don't** execute `git commit` - AI should not commit code
---
## Quick Reference
### Must-read Before Development
| Task Type | Must-read Document |
|-----------|-------------------|
| Frontend work | `frontend/index.md` → relevant docs |
| Backend work | `backend/index.md` → relevant docs |
| Cross-Layer Feature | `guides/cross-layer-thinking-guide.md` |
### Commit Convention
```bash
git commit -m "type(scope): description"
```
**Type**: feat, fix, docs, refactor, test, chore
**Scope**: Module name (e.g., auth, api, ui)
### Common Commands
```bash
# Session management
./.trellis/scripts/get-context.sh # Get full context
./.trellis/scripts/add-session.sh # Record session
# Feature management
./.trellis/scripts/feature.sh list # List features
./.trellis/scripts/feature.sh create # Create feature
# Slash commands
/finish-work # Pre-commit checklist
/break-loop # Post-debug analysis
/check-cross-layer # Cross-layer verification
```
---
## Summary
Following this workflow ensures:
- [OK] Continuity across multiple sessions
- [OK] Consistent code quality
- [OK] Trackable progress
- [OK] Knowledge accumulation in structure docs
- [OK] Transparent team collaboration
**Core Philosophy**: Read before write, follow standards, record promptly, capture learnings
+1
-1

@@ -1,1 +0,1 @@

{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AA6BA,UAAU,WAAW;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAMD,wBAAsB,IAAI,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CA0P9D"}
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AA8BA,UAAU,WAAW;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAMD,wBAAsB,IAAI,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAgQ9D"}

@@ -6,2 +6,3 @@ import { execSync } from "node:child_process";

import chalk from "chalk";
import figlet from "figlet";
import inquirer from "inquirer";

@@ -17,3 +18,6 @@ import { configureClaude, configureClaudeAgents, configureClaudeHooks, } from "../configurators/claude.js";

const cwd = process.cwd();
console.log(chalk.cyan("\n🌿 Trellis - AI-assisted development workflow framework\n"));
// Generate ASCII art banner dynamically using FIGlet "Rebel" font
const banner = figlet.textSync("Trellis", { font: "Rebel" });
console.log(chalk.cyan(`\n${banner.trimEnd()}`));
console.log(chalk.gray("\n AI-assisted development workflow framework\n"));
// Set write mode based on options

@@ -53,3 +57,3 @@ let writeMode = "ask";

console.log(chalk.gray("\nTrellis supports team collaboration - each developer has their own\n" +
`progress directory (${PATHS.PROGRESS}/<name>/) to track AI sessions.\n` +
`progress directory (${PATHS.PROGRESS}/{name}/) to track AI sessions.\n` +
"Tip: Usually this is your git username (git config user.name).\n"));

@@ -152,7 +156,6 @@ developerName = await askInput("Your name: ");

// Create bootstrap feature to guide user through filling guidelines
console.log(chalk.blue("📋 Creating bootstrap feature..."));
const bootstrapScriptPath = path.join(cwd, PATHS.SCRIPTS, "create-bootstrap.sh");
execSync(`bash "${bootstrapScriptPath}" "${projectType}"`, {
cwd,
stdio: "inherit",
stdio: "pipe", // Silent - we handle output in init
});

@@ -180,13 +183,18 @@ bootstrapCreated = true;

else if (bootstrapCreated) {
console.log(chalk.gray(`${stepNum}. Your first task: `) +
chalk.white("Fill in project guidelines") +
chalk.gray(" (a bootstrap feature has been created to guide you)"));
console.log(chalk.gray(`${stepNum}. Use `) +
chalk.white("/start") +
chalk.gray(" command in your AI tool to begin a session"));
stepNum++;
console.log(chalk.gray(`${stepNum}. Ask AI to help you `) +
chalk.white("fill in project guidelines") +
chalk.gray(` in ${PATHS.STRUCTURE}/\n`));
}
console.log(chalk.gray(`${stepNum}. Use `) +
chalk.white("/start") +
chalk.gray(" command in your AI tool to begin a session\n"));
else {
console.log(chalk.gray(`${stepNum}. Use `) +
chalk.white("/start") +
chalk.gray(" command in your AI tool to begin a session\n"));
}
// Print structure info
console.log(chalk.cyan("Generated structure files:"));
console.log(chalk.gray(` ${PATHS.STRUCTURE}/flows/ - Thinking guides (filled)`));
console.log(chalk.gray(` ${PATHS.STRUCTURE}/guides/ - Thinking guides (filled)`));
if (projectType === "frontend" ||

@@ -193,0 +201,0 @@ projectType === "fullstack" ||

@@ -1,1 +0,1 @@

{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,QAAQ,MAAM,eAAe,CAAC;AACrC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAA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,0BAA0B,CAAC,CAAC,CAAC;IACtD,CAAC;IAED,gCAAgC;IAChC,MAAM,aAAa,GAAG,MAAM,SAAS,CAAC,UAAU,EAAE,eAAe,CAAC,CAAC;IACnE,IAAI,aAAa,EAAE,CAAC;QAClB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC,CAAC;IAClD,CAAC;AACH,CAAC"}

@@ -12,7 +12,7 @@ /**

* Agents are specialized subagents that work together:
* - coder: Code writing expert
* - checker: Code self-check expert
* - fixer: Issue fixing expert
* - searcher: Search expert
* - router: Pipeline dispatcher
* - implement: Code implementation expert
* - check: Code and cross-layer check expert
* - debug: Issue fixing expert
* - research: Search expert
* - dispatch: Pipeline dispatcher
*/

@@ -19,0 +19,0 @@ export declare function configureClaudeAgents(cwd: string): Promise<void>;

@@ -29,7 +29,7 @@ import path from "node:path";

* Agents are specialized subagents that work together:
* - coder: Code writing expert
* - checker: Code self-check expert
* - fixer: Issue fixing expert
* - searcher: Search expert
* - router: Pipeline dispatcher
* - implement: Code implementation expert
* - check: Code and cross-layer check expert
* - debug: Issue fixing expert
* - research: Search expert
* - dispatch: Pipeline dispatcher
*/

@@ -36,0 +36,0 @@ export async function configureClaudeAgents(cwd) {

@@ -10,3 +10,3 @@ import path from "node:path";

// Import markdown templates
import { agentProgressIndexContent, flowMdContent, workflowGitignoreContent,
import { agentProgressIndexContent, workflowMdContent, workflowGitignoreContent,
// Backend structure (multi-doc)

@@ -16,4 +16,4 @@ backendIndexContent, backendDirectoryStructureContent, backendDatabaseGuidelinesContent, backendLoggingGuidelinesContent, backendQualityGuidelinesContent, backendErrorHandlingContent,

frontendIndexContent, frontendDirectoryStructureContent, frontendTypeSafetyContent, frontendHookGuidelinesContent, frontendComponentGuidelinesContent, frontendQualityGuidelinesContent, frontendStateManagementContent,
// Flows structure
flowsIndexContent, flowsCrossLayerThinkingGuideContent, flowsCodeReuseThinkingGuideContent, } from "../templates/markdown/index.js";
// Guides structure
guidesIndexContent, guidesCrossLayerThinkingGuideContent, guidesCodeReuseThinkingGuideContent, } from "../templates/markdown/index.js";
import { writeFile, ensureDir } from "../utils/file-writer.js";

@@ -35,3 +35,3 @@ /**

PATHS.STRUCTURE,
`${PATHS.STRUCTURE}/flows`, // Always created
`${PATHS.STRUCTURE}/guides`, // Always created
];

@@ -59,4 +59,4 @@ // Add type-specific directories

await createStructureTemplates(cwd, projectType);
// Create flow.md
await createFlowMd(cwd);
// Create workflow.md
await createWorkflowMd(cwd);
// Create .gitignore for workflow

@@ -94,16 +94,16 @@ await createWorkflowGitignore(cwd);

async function createStructureTemplates(cwd, projectType) {
// Flows structure - always created
const flowsDocs = [
{ name: "index.md", content: flowsIndexContent },
// Guides structure - always created
const guidesDocs = [
{ name: "index.md", content: guidesIndexContent },
{
name: "cross-layer-thinking-guide.md",
content: flowsCrossLayerThinkingGuideContent,
content: guidesCrossLayerThinkingGuideContent,
},
{
name: "code-reuse-thinking-guide.md",
content: flowsCodeReuseThinkingGuideContent,
content: guidesCodeReuseThinkingGuideContent,
},
];
for (const doc of flowsDocs) {
await writeFile(path.join(cwd, `${PATHS.STRUCTURE}/flows`, doc.name), doc.content);
for (const doc of guidesDocs) {
await writeFile(path.join(cwd, `${PATHS.STRUCTURE}/guides`, doc.name), doc.content);
}

@@ -168,4 +168,4 @@ // Backend structure - for backend/fullstack/unknown

}
async function createFlowMd(cwd) {
await writeFile(path.join(cwd, PATHS.FLOW_FILE), flowMdContent);
async function createWorkflowMd(cwd) {
await writeFile(path.join(cwd, PATHS.WORKFLOW_GUIDE_FILE), workflowMdContent);
}

@@ -172,0 +172,0 @@ async function createWorkflowGitignore(cwd) {

@@ -1,1 +0,1 @@

{"version":3,"file":"workflow.js","sourceRoot":"","sources":["../../src/configurators/workflow.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAEzD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3C;YACD,EAAE,IAAI,EAAE,gBAAgB,EAAE,OAAO,EAAE,yBAAyB,EAAE;YAC9D,EAAE,IAAI,EAAE,oBAAoB,EAAE,OAAO,EAAE,6BAA6B,EAAE;YACtE;gBACE,IAAI,EAAE,yBAAyB;gBAC/B,OAAO,EAAE,kCAAkC;aAC5C;YACD;gBACE,IAAI,EAAE,uBAAuB;gBAC7B,OAAO,EAAE,gCAAgC;aAC1C;YACD;gBACE,IAAI,EAAE,qBAAqB;gBAC3B,OAAO,EAAE,8BAA8B;aACxC;SACF,CAAC;QAEF,KAAK,MAAM,GAAG,IAAI,YAAY,EAAE,CAAC;YAC/B,MAAM,SAAS,CACb,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC,SAAS,WAAW,EAAE,GAAG,CAAC,IAAI,CAAC,EACvD,GAAG,CAAC,OAAO,CACZ,CAAC;QACJ,CAAC;IACH,CAAC;AACH,CAAC;AAED,KAAK,UAAU,gBAAgB,CAAC,GAAW;IACzC,MAAM,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,mBAAmB,CAAC,EAAE,iBAAiB,CAAC,CAAC;AAChF,CAAC;AAED,KAAK,UAAU,uBAAuB,CAAC,GAAW;IAChD,MAAM,SAAS,CACb,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,SAAS,CAAC,QAAQ,EAAE,YAAY,CAAC,EAChD,wBAAwB,CACzB,CAAC;AACJ,CAAC"}

@@ -9,4 +9,4 @@ /**

/** Root workflow directory */
readonly WORKFLOW: "workflow";
/** Progress tracking directory (under workflow/) */
readonly WORKFLOW: ".trellis";
/** Progress tracking directory (under .trellis/) */
readonly PROGRESS: "agent-traces";

@@ -17,5 +17,5 @@ /** Features directory (under progress/{developer}/) */

readonly ARCHIVE: "archive";
/** Structure/guidelines directory (under workflow/) */
/** Structure/guidelines directory (under .trellis/) */
readonly STRUCTURE: "structure";
/** Scripts directory (under workflow/) */
/** Scripts directory (under .trellis/) */
readonly SCRIPTS: "scripts";

@@ -33,23 +33,23 @@ };

/** Workflow guide */
readonly FLOW: "flow.md";
readonly WORKFLOW_GUIDE: "workflow.md";
};
export declare const PATHS: {
/** workflow/ */
readonly WORKFLOW: "workflow";
/** workflow/agent-traces/ */
readonly PROGRESS: "workflow/agent-traces";
/** workflow/structure/ */
readonly STRUCTURE: "workflow/structure";
/** workflow/scripts/ */
readonly SCRIPTS: "workflow/scripts";
/** workflow/.developer */
readonly DEVELOPER_FILE: "workflow/.developer";
/** workflow/.current-feature */
readonly CURRENT_FEATURE_FILE: "workflow/.current-feature";
/** workflow/flow.md */
readonly FLOW_FILE: "workflow/flow.md";
/** .trellis/ */
readonly WORKFLOW: ".trellis";
/** .trellis/agent-traces/ */
readonly PROGRESS: ".trellis/agent-traces";
/** .trellis/structure/ */
readonly STRUCTURE: ".trellis/structure";
/** .trellis/scripts/ */
readonly SCRIPTS: ".trellis/scripts";
/** .trellis/.developer */
readonly DEVELOPER_FILE: ".trellis/.developer";
/** .trellis/.current-feature */
readonly CURRENT_FEATURE_FILE: ".trellis/.current-feature";
/** .trellis/workflow.md */
readonly WORKFLOW_GUIDE_FILE: ".trellis/workflow.md";
};
/**
* Get developer's progress directory path
* @example getProgressDir("john") => "workflow/agent-traces/john"
* @example getProgressDir("john") => ".trellis/agent-traces/john"
*/

@@ -59,3 +59,3 @@ export declare function getProgressDir(developer: string): string;

* Get developer's features directory path
* @example getFeaturesDir("john") => "workflow/agent-traces/john/features"
* @example getFeaturesDir("john") => ".trellis/agent-traces/john/features"
*/

@@ -65,3 +65,3 @@ export declare function getFeaturesDir(developer: string): string;

* Get feature directory path
* @example getFeatureDir("john", "my-feature") => "workflow/agent-traces/john/features/my-feature"
* @example getFeatureDir("john", "my-feature") => ".trellis/agent-traces/john/features/my-feature"
*/

@@ -71,5 +71,5 @@ export declare function getFeatureDir(developer: string, featureName: string): string;

* Get archive directory path
* @example getArchiveDir("john") => "workflow/agent-traces/john/features/archive"
* @example getArchiveDir("john") => ".trellis/agent-traces/john/features/archive"
*/
export declare function getArchiveDir(developer: string): string;
//# sourceMappingURL=paths.d.ts.map

@@ -1,1 +0,1 @@

{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../src/constants/paths.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,eAAO,MAAM,SAAS;IACpB,8BAA8B;;IAE9B,oDAAoD;;IAEpD,uDAAuD;;IAEvD,0CAA0C;;IAE1C,uDAAuD;;IAEvD,0CAA0C;;CAElC,CAAC;AAGX,eAAO,MAAM,UAAU;IACrB,8BAA8B;;IAE9B,8BAA8B;;IAE9B,uBAAuB;;IAEvB,4BAA4B;;IAE5B,qBAAqB;;CAEb,CAAC;AAGX,eAAO,MAAM,KAAK;IAChB,gBAAgB;;IAEhB,6BAA6B;;IAE7B,0BAA0B;;IAE1B,wBAAwB;;IAExB,0BAA0B;;IAE1B,gCAAgC;;IAEhC,uBAAuB;;CAEf,CAAC;AAEX;;;GAGG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAExD;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAExD;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAE5E;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAEvD"}
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../src/constants/paths.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,eAAO,MAAM,SAAS;IACpB,8BAA8B;;IAE9B,oDAAoD;;IAEpD,uDAAuD;;IAEvD,0CAA0C;;IAE1C,uDAAuD;;IAEvD,0CAA0C;;CAElC,CAAC;AAGX,eAAO,MAAM,UAAU;IACrB,8BAA8B;;IAE9B,8BAA8B;;IAE9B,uBAAuB;;IAEvB,4BAA4B;;IAE5B,qBAAqB;;CAEb,CAAC;AAGX,eAAO,MAAM,KAAK;IAChB,gBAAgB;;IAEhB,6BAA6B;;IAE7B,0BAA0B;;IAE1B,wBAAwB;;IAExB,0BAA0B;;IAE1B,gCAAgC;;IAEhC,2BAA2B;;CAEnB,CAAC;AAEX;;;GAGG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAExD;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAExD;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAE5E;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAEvD"}

@@ -10,4 +10,4 @@ /**

/** Root workflow directory */
WORKFLOW: "workflow",
/** Progress tracking directory (under workflow/) */
WORKFLOW: ".trellis",
/** Progress tracking directory (under .trellis/) */
PROGRESS: "agent-traces",

@@ -18,5 +18,5 @@ /** Features directory (under progress/{developer}/) */

ARCHIVE: "archive",
/** Structure/guidelines directory (under workflow/) */
/** Structure/guidelines directory (under .trellis/) */
STRUCTURE: "structure",
/** Scripts directory (under workflow/) */
/** Scripts directory (under .trellis/) */
SCRIPTS: "scripts",

@@ -35,24 +35,24 @@ };

/** Workflow guide */
FLOW: "flow.md",
WORKFLOW_GUIDE: "workflow.md",
};
// Constructed paths (relative to project root)
export const PATHS = {
/** workflow/ */
/** .trellis/ */
WORKFLOW: DIR_NAMES.WORKFLOW,
/** workflow/agent-traces/ */
/** .trellis/agent-traces/ */
PROGRESS: `${DIR_NAMES.WORKFLOW}/${DIR_NAMES.PROGRESS}`,
/** workflow/structure/ */
/** .trellis/structure/ */
STRUCTURE: `${DIR_NAMES.WORKFLOW}/${DIR_NAMES.STRUCTURE}`,
/** workflow/scripts/ */
/** .trellis/scripts/ */
SCRIPTS: `${DIR_NAMES.WORKFLOW}/${DIR_NAMES.SCRIPTS}`,
/** workflow/.developer */
/** .trellis/.developer */
DEVELOPER_FILE: `${DIR_NAMES.WORKFLOW}/${FILE_NAMES.DEVELOPER}`,
/** workflow/.current-feature */
/** .trellis/.current-feature */
CURRENT_FEATURE_FILE: `${DIR_NAMES.WORKFLOW}/${FILE_NAMES.CURRENT_FEATURE}`,
/** workflow/flow.md */
FLOW_FILE: `${DIR_NAMES.WORKFLOW}/${FILE_NAMES.FLOW}`,
/** .trellis/workflow.md */
WORKFLOW_GUIDE_FILE: `${DIR_NAMES.WORKFLOW}/${FILE_NAMES.WORKFLOW_GUIDE}`,
};
/**
* Get developer's progress directory path
* @example getProgressDir("john") => "workflow/agent-traces/john"
* @example getProgressDir("john") => ".trellis/agent-traces/john"
*/

@@ -64,3 +64,3 @@ export function getProgressDir(developer) {

* Get developer's features directory path
* @example getFeaturesDir("john") => "workflow/agent-traces/john/features"
* @example getFeaturesDir("john") => ".trellis/agent-traces/john/features"
*/

@@ -72,3 +72,3 @@ export function getFeaturesDir(developer) {

* Get feature directory path
* @example getFeatureDir("john", "my-feature") => "workflow/agent-traces/john/features/my-feature"
* @example getFeatureDir("john", "my-feature") => ".trellis/agent-traces/john/features/my-feature"
*/

@@ -80,3 +80,3 @@ export function getFeatureDir(developer, featureName) {

* Get archive directory path
* @example getArchiveDir("john") => "workflow/agent-traces/john/features/archive"
* @example getArchiveDir("john") => ".trellis/agent-traces/john/features/archive"
*/

@@ -83,0 +83,0 @@ export function getArchiveDir(developer) {

@@ -1,1 +0,1 @@

{"version":3,"file":"paths.js","sourceRoot":"","sources":["../../src/constants/paths.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,mCAAmC;AACnC,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,8BAA8B;IAC9B,QAAQ,EAAE,UAAU;IACpB,oDAAoD;IACpD,QAAQ,EAAE,cAAc;IACxB,uDAAuD;IACvD,QAAQ,EAAE,UAAU;IACpB,0CA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SAAS,CAAC,QAAQ,IAAI,SAAS,CAAC,SAAS,EAAE;IACzD,wBAAwB;IACxB,OAAO,EAAE,GAAG,SAAS,CAAC,QAAQ,IAAI,SAAS,CAAC,OAAO,EAAE;IACrD,0BAA0B;IAC1B,cAAc,EAAE,GAAG,SAAS,CAAC,QAAQ,IAAI,UAAU,CAAC,SAAS,EAAE;IAC/D,gCAAgC;IAChC,oBAAoB,EAAE,GAAG,SAAS,CAAC,QAAQ,IAAI,UAAU,CAAC,eAAe,EAAE;IAC3E,2BAA2B;IAC3B,mBAAmB,EAAE,GAAG,SAAS,CAAC,QAAQ,IAAI,UAAU,CAAC,cAAc,EAAE;CACjE,CAAC;AAEX;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,SAAiB;IAC9C,OAAO,GAAG,KAAK,CAAC,QAAQ,IAAI,SAAS,EAAE,CAAC;AAC1C,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,SAAiB;IAC9C,OAAO,GAAG,cAAc,CAAC,SAAS,CAAC,IAAI,SAAS,CAAC,QAAQ,EAAE,CAAC;AAC9D,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,SAAiB,EAAE,WAAmB;IAClE,OAAO,GAAG,cAAc,CAAC,SAAS,CAAC,IAAI,WAAW,EAAE,CAAC;AACvD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,SAAiB;IAC7C,OAAO,GAAG,cAAc,CAAC,SAAS,CAAC,IAAI,SAAS,CAAC,OAAO,EAAE,CAAC;AAC7D,CAAC"}

@@ -5,13 +5,13 @@ /**

* These agents work together in a pipeline:
* - Router: Pure dispatcher, orchestrates other agents
* - Coder: Code writing expert
* - Checker: Code self-check expert
* - Fixer: Issue fixing expert
* - Searcher: Code and tech search expert
* - dispatch: Pure dispatcher, orchestrates other agents
* - implement: Code implementation expert
* - check: Code and cross-layer check expert
* - debug: Issue fixing expert
* - research: Code and tech search expert
*/
export declare const coderAgentTemplate: string;
export declare const checkerAgentTemplate: string;
export declare const fixerAgentTemplate: string;
export declare const searcherAgentTemplate: string;
export declare const routerAgentTemplate: string;
export declare const implementAgentTemplate: string;
export declare const checkAgentTemplate: string;
export declare const debugAgentTemplate: string;
export declare const researchAgentTemplate: string;
export declare const dispatchAgentTemplate: string;
/**

@@ -18,0 +18,0 @@ * Agent template definition

@@ -1,1 +0,1 @@

{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/templates/agents/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAkBH,eAAO,MAAM,kBAAkB,EAAE,MAA+B,CAAC;AACjE,eAAO,MAAM,oBAAoB,EAAE,MAAiC,CAAC;AACrE,eAAO,MAAM,kBAAkB,EAAE,MAA+B,CAAC;AACjE,eAAO,MAAM,qBAAqB,EAAE,MAAkC,CAAC;AACvE,eAAO,MAAM,mBAAmB,EAAE,MAAgC,CAAC;AAEnE;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,qCAAqC;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,uBAAuB;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,iCAAiC;IACjC,WAAW,EAAE,MAAM,CAAC;CACrB;AAiCD;;GAEG;AACH,wBAAgB,YAAY,IAAI,aAAa,EAAE,CAE9C;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,CAEtE"}
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/templates/agents/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAkBH,eAAO,MAAM,sBAAsB,EAAE,MAAmC,CAAC;AACzE,eAAO,MAAM,kBAAkB,EAAE,MAA+B,CAAC;AACjE,eAAO,MAAM,kBAAkB,EAAE,MAA+B,CAAC;AACjE,eAAO,MAAM,qBAAqB,EAAE,MAAkC,CAAC;AACvE,eAAO,MAAM,qBAAqB,EAAE,MAAkC,CAAC;AAEvE;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,qCAAqC;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,uBAAuB;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,iCAAiC;IACjC,WAAW,EAAE,MAAM,CAAC;CACrB;AAmCD;;GAEG;AACH,wBAAgB,YAAY,IAAI,aAAa,EAAE,CAE9C;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,CAEtE"}

@@ -5,7 +5,7 @@ /**

* These agents work together in a pipeline:
* - Router: Pure dispatcher, orchestrates other agents
* - Coder: Code writing expert
* - Checker: Code self-check expert
* - Fixer: Issue fixing expert
* - Searcher: Code and tech search expert
* - dispatch: Pure dispatcher, orchestrates other agents
* - implement: Code implementation expert
* - check: Code and cross-layer check expert
* - debug: Issue fixing expert
* - research: Code and tech search expert
*/

@@ -25,7 +25,7 @@ import { readFileSync } from "fs";

// Agent templates
export const coderAgentTemplate = readAgent("coder.txt");
export const checkerAgentTemplate = readAgent("checker.txt");
export const fixerAgentTemplate = readAgent("fixer.txt");
export const searcherAgentTemplate = readAgent("searcher.txt");
export const routerAgentTemplate = readAgent("router.txt");
export const implementAgentTemplate = readAgent("implement.txt");
export const checkAgentTemplate = readAgent("check.txt");
export const debugAgentTemplate = readAgent("debug.txt");
export const researchAgentTemplate = readAgent("research.txt");
export const dispatchAgentTemplate = readAgent("dispatch.txt");
/**

@@ -36,24 +36,24 @@ * All available agent templates

{
name: "coder",
content: coderAgentTemplate,
description: "Code writing expert - implements features following specs",
name: "implement",
content: implementAgentTemplate,
description: "Code implementation expert - implements features following specs",
},
{
name: "checker",
content: checkerAgentTemplate,
description: "Code self-check expert - validates and fixes code quality",
name: "check",
content: checkAgentTemplate,
description: "Check expert - validates code quality and cross-layer consistency",
},
{
name: "fixer",
content: fixerAgentTemplate,
description: "Issue fixing expert - fixes code review issues",
name: "debug",
content: debugAgentTemplate,
description: "Debug expert - fixes code review issues",
},
{
name: "searcher",
content: searcherAgentTemplate,
description: "Search expert - finds code patterns and tech solutions",
name: "research",
content: researchAgentTemplate,
description: "Research expert - finds code patterns and tech solutions",
},
{
name: "router",
content: routerAgentTemplate,
name: "dispatch",
content: dispatchAgentTemplate,
description: "Pipeline dispatcher - orchestrates other agents",

@@ -60,0 +60,0 @@ },

@@ -1,1 +0,1 @@

{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/templates/agents/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEpC,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAEtC;;GAEG;AACH,SAAS,SAAS,CAAC,QAAgB;IACjC,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IAC3C,OAAO,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AACzC,CAAC;AAED,kBAAkB;AAClB,MAAM,CAAC,MAAM,kBAAkB,GAAW,SAAS,CAAC,WAAW,CAAC,CAAC;AACjE,MAAM,CAAC,MAAM,oBAAoB,GAAW,SAAS,CAAC,aAAa,CAAC,CAAC;AACrE,MAAM,CAAC,MAAM,kBAAkB,GAAW,SAAS,CAAC,WAAW,CAAC,CAAC;AACjE,MAAM,CAAC,MAAM,qBAAqB,GAAW,SAAS,CAAC,cAAc,CAAC,CAAC;AACvE,MAAM,CAAC,MAAM,mBAAmB,GAAW,SAAS,CAAC,YAAY,CAAC,CAAC;AAcnE;;GAEG;AACH,MAAM,UAAU,GAAoB;IAClC;QACE,IAAI,EAAE,OAAO;QACb,OAAO,EAAE,kBAAkB;Q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,sBAAsB,GAAW,SAAS,CAAC,eAAe,CAAC,CAAC;AACzE,MAAM,CAAC,MAAM,kBAAkB,GAAW,SAAS,CAAC,WAAW,CAAC,CAAC;AACjE,MAAM,CAAC,MAAM,kBAAkB,GAAW,SAAS,CAAC,WAAW,CAAC,CAAC;AACjE,MAAM,CAAC,MAAM,qBAAqB,GAAW,SAAS,CAAC,cAAc,CAAC,CAAC;AACvE,MAAM,CAAC,MAAM,qBAAqB,GAAW,SAAS,CAAC,cAAc,CAAC,CAAC;AAcvE;;GAEG;AACH,MAAM,UAAU,GAAoB;IAClC;QACE,IAAI,EAAE,WAAW;QACjB,OAAO,EAAE,sBAAsB;QAC/B,WAAW,EACT,kEAAkE;KACrE;IACD;QACE,IAAI,EAAE,OAAO;QACb,OAAO,EAAE,kBAAkB;QAC3B,WAAW,EACT,mEAAmE;KACtE;IACD;QACE,IAAI,EAAE,OAAO;QACb,OAAO,EAAE,kBAAkB;QAC3B,WAAW,EAAE,yCAAyC;KACvD;IACD;QACE,IAAI,EAAE,UAAU;QAChB,OAAO,EAAE,qBAAqB;QAC9B,WAAW,EAAE,0DAA0D;KACxE;IACD;QACE,IAAI,EAAE,UAAU;QAChB,OAAO,EAAE,qBAAqB;QAC9B,WAAW,EAAE,iDAAiD;KAC/D;CACF,CAAC;AAEF;;GAEG;AACH,MAAM,UAAU,YAAY;IAC1B,OAAO,UAAU,CAAC;AACpB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,IAAY;IACzC,OAAO,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;AACjD,CAAC"}

@@ -9,6 +9,6 @@ # Start Session

```bash
./workflow/scripts/get-context.sh
./.trellis/scripts/get-context.sh
```
2. Read `workflow/structure/flows/index.md` for thinking guidelines
2. Read `.trellis/structure/guides/index.md` for thinking guidelines

@@ -24,4 +24,4 @@ 3. Report ready status and ask for task

1. Read relevant guidelines based on task type:
- Frontend: `workflow/structure/frontend/`
- Backend: `workflow/structure/backend/`
- Frontend: `.trellis/structure/frontend/`
- Backend: `.trellis/structure/backend/`

@@ -39,4 +39,4 @@ 2. Implement the task directly

```bash
./workflow/scripts/feature.sh create <name>
# Example: ./workflow/scripts/feature.sh create user-auth
./.trellis/scripts/feature.sh create <name>
# Example: ./.trellis/scripts/feature.sh create user-auth
```

@@ -47,4 +47,4 @@

```bash
FEATURE_DIR="workflow/agent-traces/{developer}/features/{feature-name}"
./workflow/scripts/feature.sh init-context "$FEATURE_DIR" <type>
FEATURE_DIR=".trellis/agent-traces/{developer}/features/{feature-name}"
./.trellis/scripts/feature.sh init-context "$FEATURE_DIR" <type>
# type: backend | frontend | fullstack

@@ -59,4 +59,4 @@ ```

# Example: adding database and API guidelines for a backend task
./workflow/scripts/feature.sh add-context "$FEATURE_DIR" coder "workflow/structure/backend/database-guidelines.md"
./workflow/scripts/feature.sh add-context "$FEATURE_DIR" coder "workflow/structure/backend/api-module.md"
./.trellis/scripts/feature.sh add-context "$FEATURE_DIR" implement ".trellis/structure/backend/database-guidelines.md"
./.trellis/scripts/feature.sh add-context "$FEATURE_DIR" implement ".trellis/structure/backend/api-module.md"
```

@@ -66,3 +66,3 @@

```bash
./workflow/scripts/feature.sh list-context "$FEATURE_DIR"
./.trellis/scripts/feature.sh list-context "$FEATURE_DIR"
```

@@ -79,3 +79,3 @@

```bash
./workflow/scripts/feature.sh start "$FEATURE_DIR"
./.trellis/scripts/feature.sh start "$FEATURE_DIR"
```

@@ -88,3 +88,3 @@

```
Task(subagent_type: "coder", prompt: "Implement the feature described in prd.md", model: "sonnet")
Task(subagent_type: "implement", prompt: "Implement the feature described in prd.md", model: "sonnet")
```

@@ -95,3 +95,3 @@

```
Task(subagent_type: "checker", prompt: "Check code changes and fix any issues", model: "sonnet")
Task(subagent_type: "check", prompt: "Check code changes and fix any issues", model: "sonnet")
```

@@ -107,3 +107,3 @@

```bash
./workflow/scripts/feature.sh archive <feature-name>
./.trellis/scripts/feature.sh archive <feature-name>
```

@@ -128,3 +128,3 @@

| New feature / multi-file change | Use feature tracking + delegation |
| Research / exploration | Use searcher agent |
| Research / exploration | Use research agent |

@@ -131,0 +131,0 @@ | Command | Purpose |

Read the backend development guidelines before starting your development task.
Execute these steps:
1. Read `workflow/structure/backend/index.md` to understand available guidelines
1. Read `.trellis/structure/backend/index.md` to understand available guidelines
2. Based on your task, read the relevant guideline files:
- Database work → `workflow/structure/backend/database-guidelines.md`
- Error handling → `workflow/structure/backend/error-handling.md`
- Logging → `workflow/structure/backend/logging-guidelines.md`
- Type questions → `workflow/structure/backend/type-safety.md`
- Database work → `.trellis/structure/backend/database-guidelines.md`
- Error handling → `.trellis/structure/backend/error-handling.md`
- Logging → `.trellis/structure/backend/logging-guidelines.md`
- Type questions → `.trellis/structure/backend/type-safety.md`
3. Understand the coding standards and patterns you need to follow

@@ -11,0 +11,0 @@ 4. Then proceed with your development plan

Read the frontend development guidelines before starting your development task.
Execute these steps:
1. Read `workflow/structure/frontend/index.md` to understand available guidelines
1. Read `.trellis/structure/frontend/index.md` to understand available guidelines
2. Based on your task, read the relevant guideline files:
- Component work → `workflow/structure/frontend/component-guidelines.md`
- Hook work → `workflow/structure/frontend/hook-guidelines.md`
- State management → `workflow/structure/frontend/state-management.md`
- Type questions → `workflow/structure/frontend/type-safety.md`
- Component work → `.trellis/structure/frontend/component-guidelines.md`
- Hook work → `.trellis/structure/frontend/hook-guidelines.md`
- State management → `.trellis/structure/frontend/state-management.md`
- Type questions → `.trellis/structure/frontend/type-safety.md`
3. Understand the coding standards and patterns you need to follow

@@ -11,0 +11,0 @@ 4. Then proceed with your development plan

@@ -58,4 +58,4 @@ # Break the Loop - Deep Bug Analysis

- [ ] Update `workflow/structure/flows/` thinking guides
- [ ] Update `workflow/structure/backend/` or `frontend/` docs
- [ ] Update `.trellis/structure/guides/` thinking guides
- [ ] Update `.trellis/structure/backend/` or `frontend/` docs
- [ ] Create issue record (if applicable)

@@ -62,0 +62,0 @@ - [ ] Create feature ticket for root fix

@@ -5,10 +5,10 @@ Check if the code you just wrote follows the backend development guidelines.

1. Run `git status` to see modified files
2. Read `workflow/structure/backend/index.md` to understand which guidelines apply
2. Read `.trellis/structure/backend/index.md` to understand which guidelines apply
3. Based on what you changed, read the relevant guideline files:
- Database changes → `workflow/structure/backend/database-guidelines.md`
- Error handling → `workflow/structure/backend/error-handling.md`
- Logging changes → `workflow/structure/backend/logging-guidelines.md`
- Type changes → `workflow/structure/backend/type-safety.md`
- Any changes → `workflow/structure/backend/quality-guidelines.md`
- Database changes → `.trellis/structure/backend/database-guidelines.md`
- Error handling → `.trellis/structure/backend/error-handling.md`
- Logging changes → `.trellis/structure/backend/logging-guidelines.md`
- Type changes → `.trellis/structure/backend/type-safety.md`
- Any changes → `.trellis/structure/backend/quality-guidelines.md`
4. Review your code against the guidelines
5. Report any violations and fix them if found

@@ -5,3 +5,3 @@ # Cross-Layer Check

> **Note**: This is a **post-implementation** safety net. Ideally, read the [Pre-Implementation Checklist](workflow/structure/flows/pre-implementation-checklist.md) **before** writing code.
> **Note**: This is a **post-implementation** safety net. Ideally, read the [Pre-Implementation Checklist](.trellis/structure/guides/pre-implementation-checklist.md) **before** writing code.

@@ -14,4 +14,4 @@ ---

|----------|---------|--------|
| [Pre-Implementation Checklist](workflow/structure/flows/pre-implementation-checklist.md) | Questions before coding | **Before** writing code |
| [Code Reuse Thinking Guide](workflow/structure/flows/code-reuse-thinking-guide.md) | Pattern recognition | During implementation |
| [Pre-Implementation Checklist](.trellis/structure/guides/pre-implementation-checklist.md) | Questions before coding | **Before** writing code |
| [Code Reuse Thinking Guide](.trellis/structure/guides/code-reuse-thinking-guide.md) | Pattern recognition | During implementation |
| **`/check-cross-layer`** (this) | Verification check | **After** implementation |

@@ -56,3 +56,3 @@

**Detailed Guide**: `workflow/structure/flows/cross-layer-thinking-guide.md`
**Detailed Guide**: `.trellis/structure/guides/cross-layer-thinking-guide.md`

@@ -79,3 +79,3 @@ ---

**Detailed Guide**: `workflow/structure/flows/code-reuse-thinking-guide.md`
**Detailed Guide**: `.trellis/structure/guides/code-reuse-thinking-guide.md`

@@ -82,0 +82,0 @@ ---

@@ -5,10 +5,10 @@ Check if the code you just wrote follows the frontend development guidelines.

1. Run `git status` to see modified files
2. Read `workflow/structure/frontend/index.md` to understand which guidelines apply
2. Read `.trellis/structure/frontend/index.md` to understand which guidelines apply
3. Based on what you changed, read the relevant guideline files:
- Component changes → `workflow/structure/frontend/component-guidelines.md`
- Hook changes → `workflow/structure/frontend/hook-guidelines.md`
- State changes → `workflow/structure/frontend/state-management.md`
- Type changes → `workflow/structure/frontend/type-safety.md`
- Any changes → `workflow/structure/frontend/quality-guidelines.md`
- Component changes → `.trellis/structure/frontend/component-guidelines.md`
- Hook changes → `.trellis/structure/frontend/hook-guidelines.md`
- State changes → `.trellis/structure/frontend/state-management.md`
- Type changes → `.trellis/structure/frontend/type-safety.md`
- Any changes → `.trellis/structure/frontend/quality-guidelines.md`
4. Review your code against the guidelines
5. Report any violations and fix them if found

@@ -134,6 +134,6 @@ # Create New Slash Command

**Frontend files** (`apps/web/`):
- Reference `workflow/structure/frontend/index.md`
- Reference `.trellis/structure/frontend/index.md`
**Backend files** (`packages/api/`):
- Reference `workflow/structure/backend/index.md`
- Reference `.trellis/structure/backend/index.md`

@@ -140,0 +140,0 @@ ### 3. Output Review Report

@@ -30,7 +30,7 @@ # Finish Work - Pre-Commit Checklist

**Structure Docs**:
- [ ] Does `workflow/structure/backend/` need updates?
- [ ] Does `.trellis/structure/backend/` need updates?
- New patterns, new modules, new conventions
- [ ] Does `workflow/structure/frontend/` need updates?
- [ ] Does `.trellis/structure/frontend/` need updates?
- New components, new hooks, new patterns
- [ ] Does `workflow/structure/flows/` need updates?
- [ ] Does `.trellis/structure/guides/` need updates?
- New cross-layer flows, lessons from bugs

@@ -98,3 +98,3 @@

|-----------|-------------|-------|
| Structure docs not updated | Others don't know the change | Check workflow/structure/ |
| Structure docs not updated | Others don't know the change | Check .trellis/structure/ |
| Migration not created | Schema out of sync | Check db/migrations/ |

@@ -101,0 +101,0 @@ | Types not synced | Runtime errors | Check shared types |

@@ -21,4 +21,4 @@ # Integrate Claude Skill into Project Guidelines

>
> - Guidelines content -> Write to `workflow/structure/{target}/doc.md`
> - Code examples -> Place in `workflow/structure/{target}/examples/skills/<skill-name>/`
> - Guidelines content -> Write to `.trellis/structure/{target}/doc.md`
> - Code examples -> Place in `.trellis/structure/{target}/examples/skills/<skill-name>/`
> - Example files -> Use `.template` suffix (e.g., `component.tsx.template`) to avoid IDE errors

@@ -47,6 +47,6 @@ >

|----------------|-------------------|
| UI/Frontend (`frontend-design`, `web-artifacts-builder`) | `workflow/structure/frontend/` |
| Backend/API (`mcp-builder`) | `workflow/structure/backend/` |
| Documentation (`doc-coauthoring`, `docx`, `pdf`) | `workflow/` or create dedicated guidelines |
| Testing (`webapp-testing`) | `workflow/structure/frontend/` (E2E) |
| UI/Frontend (`frontend-design`, `web-artifacts-builder`) | `.trellis/structure/frontend/` |
| Backend/API (`mcp-builder`) | `.trellis/structure/backend/` |
| Documentation (`doc-coauthoring`, `docx`, `pdf`) | `.trellis/` or create dedicated guidelines |
| Testing (`webapp-testing`) | `.trellis/structure/frontend/` (E2E) |

@@ -95,3 +95,3 @@ ### 3. Analyze Skill Content

# Directory structure ({target} = frontend or backend)
workflow/structure/{target}/
.trellis/structure/{target}/
|-- doc.md # Add skill-related section

@@ -128,3 +128,3 @@ |-- index.md # Update index

- **Skill description**: [Functionality description]
- **Integration target**: `workflow/structure/{target}/`
- **Integration target**: `.trellis/structure/{target}/`

@@ -141,5 +141,5 @@ ### # Tech Stack Compatibility

|------|------|
| Guidelines doc | `workflow/structure/{target}/doc.md` (section: `skill-<name>`) |
| Code examples | `workflow/structure/{target}/examples/skills/<name>/` |
| Index update | `workflow/structure/{target}/index.md` |
| Guidelines doc | `.trellis/structure/{target}/doc.md` (section: `skill-<name>`) |
| Code examples | `.trellis/structure/{target}/examples/skills/<name>/` |
| Index update | `.trellis/structure/{target}/index.md` |

@@ -187,3 +187,3 @@ > `{target}` = `frontend` or `backend`

| `webapp-testing` | `frontend` | `examples/skills/webapp-testing/` |
| `doc-coauthoring` | `workflow/` | N/A (documentation workflow only) |
| `doc-coauthoring` | `.trellis/` | N/A (documentation workflow only) |

@@ -195,3 +195,3 @@ ## Example: Integrating `mcp-builder` Skill

```
workflow/structure/backend/
.trellis/structure/backend/
|-- doc.md # Add MCP section

@@ -198,0 +198,0 @@ |-- index.md # Add index entry

@@ -44,3 +44,3 @@ You are a senior developer onboarding a new team member to this project's AI-assisted workflow system.

**The Solution**: The `workflow/agent-traces/` system captures what happened in each session - what was done, what was learned, what problems were solved. The `/start` command reads this history at session start, giving AI "artificial memory."
**The Solution**: The `.trellis/agent-traces/` system captures what happened in each session - what was done, what was learned, what problems were solved. The `/start` command reads this history at session start, giving AI "artificial memory."

@@ -53,3 +53,3 @@ ### Challenge 2: AI Has Generic Knowledge, Not Project-Specific Knowledge

**The Solution**: The `workflow/structure/` directory contains project-specific guidelines. The `/before-*-dev` commands inject this specialized knowledge into AI context before coding starts.
**The Solution**: The `.trellis/structure/` directory contains project-specific guidelines. The `/before-*-dev` commands inject this specialized knowledge into AI context before coding starts.

@@ -69,5 +69,5 @@ ### Challenge 3: AI Context Window Is Limited

```
workflow/
.trellis/
|-- .developer # Your identity (gitignored)
|-- flow.md # Complete workflow documentation
|-- workflow.md # Complete workflow documentation
|-- agent-traces/ # "AI Memory" - session history

@@ -82,3 +82,3 @@ | |-- index.md # All developers' progress

| |-- backend/ # Backend conventions
| \-- flows/ # Cross-layer patterns
| \-- guides/ # Thinking patterns
\-- scripts/ # Automation tools

@@ -101,3 +101,3 @@ ```

**flows/** - Cross-layer thinking guides:
**guides/** - Cross-layer thinking guides:
- Code reuse thinking guide

@@ -137,3 +137,3 @@ - Cross-layer thinking guide

**WHAT IT ACTUALLY DOES**:
1. Reads `workflow/structure/frontend/` or `workflow/structure/backend/`
1. Reads `.trellis/structure/frontend/` or `.trellis/structure/backend/`
2. Loads project-specific patterns into AI's working context:

@@ -216,3 +216,3 @@ - Component naming conventions

**[1/8] /start** - AI needs project context before touching code
**[2/8] ./workflow/scripts/feature.sh create fix-bug** - Track work for future reference
**[2/8] ./.trellis/scripts/feature.sh create fix-bug** - Track work for future reference
**[3/8] /before-frontend-dev** - Inject project-specific frontend knowledge

@@ -228,3 +228,3 @@ **[4/8] Investigate and fix the bug** - Actual development work

**[1/4] /start** - Context needed even for non-coding work
**[2/4] ./workflow/scripts/feature.sh create planning-task** - Planning is valuable work
**[2/4] ./.trellis/scripts/feature.sh create planning-task** - Planning is valuable work
**[3/4] Review docs, create subtask list** - Actual planning work

@@ -276,8 +276,8 @@ **[4/4] /record-agent-flow (with --summary)** - Planning decisions must be recorded

Check if `workflow/structure/` contains empty templates or customized guidelines:
Check if `.trellis/structure/` contains empty templates or customized guidelines:
```bash
# Check if files are still empty templates (look for placeholder text)
grep -l "To be filled by the team" workflow/structure/backend/*.md 2>/dev/null | wc -l
grep -l "To be filled by the team" workflow/structure/frontend/*.md 2>/dev/null | wc -l
grep -l "To be filled by the team" .trellis/structure/backend/*.md 2>/dev/null | wc -l
grep -l "To be filled by the team" .trellis/structure/frontend/*.md 2>/dev/null | wc -l
```

@@ -293,3 +293,3 @@

"I see that the development guidelines in `workflow/structure/` are still empty templates. This is normal for a new Trellis setup!
"I see that the development guidelines in `.trellis/structure/` are still empty templates. This is normal for a new Trellis setup!

@@ -304,3 +304,3 @@ The templates contain placeholder text that needs to be replaced with YOUR project's actual conventions. Without this, `/before-*-dev` commands won't provide useful guidance.

For example, for `workflow/structure/backend/database-guidelines.md`:
For example, for `.trellis/structure/backend/database-guidelines.md`:
- What ORM/query library does your project use?

@@ -320,3 +320,3 @@ - How are migrations managed?

I recommend reading through `workflow/structure/` to familiarize yourself with the team's coding standards."
I recommend reading through `.trellis/structure/` to familiarize yourself with the team's coding standards."

@@ -328,3 +328,3 @@ ## Step 3: Help Fill Guidelines (If Empty)

```bash
./workflow/scripts/feature.sh create fill-structure-guidelines
./.trellis/scripts/feature.sh create fill-structure-guidelines
```

@@ -365,5 +365,5 @@

1. Run `/record-agent-flow` to record this onboard session
2. [If guidelines empty] Start filling in `workflow/structure/` guidelines
2. [If guidelines empty] Start filling in `.trellis/structure/` guidelines
3. [If guidelines ready] Start your first development task
What would you like to do first?"

@@ -12,3 +12,3 @@ [!] **Prerequisite**: This command should only be used AFTER the human has tested and committed the code.

```bash
./workflow/scripts/get-context.sh
./.trellis/scripts/get-context.sh
```

@@ -20,3 +20,3 @@

# Method 1: Simple parameters
./workflow/scripts/add-session.sh \
./.trellis/scripts/add-session.sh \
--title "Session Title" \

@@ -27,3 +27,3 @@ --commit "hash1,hash2" \

# Method 2: Pass detailed content via stdin
cat << 'EOF' | ./workflow/scripts/add-session.sh --title "Title" --commit "hash"
cat << 'EOF' | ./.trellis/scripts/add-session.sh --title "Title" --commit "hash"
| Feature | Description |

@@ -52,3 +52,3 @@ |---------|-------------|

```bash
./workflow/scripts/feature.sh archive <feature-name>
./.trellis/scripts/feature.sh archive <feature-name>
```

@@ -55,0 +55,0 @@

@@ -12,3 +12,3 @@ # Initialize AI Agent Session

```bash
./workflow/scripts/get-context.sh
./.trellis/scripts/get-context.sh
```

@@ -29,3 +29,3 @@

```bash
cat workflow/structure/frontend/index.md
cat .trellis/structure/frontend/index.md
```

@@ -36,3 +36,3 @@ Then read specific docs based on task type.

```bash
cat workflow/structure/backend/index.md
cat .trellis/structure/backend/index.md
```

@@ -43,4 +43,4 @@ Then read specific docs based on task type.

```bash
cat workflow/structure/flows/index.md
cat workflow/structure/flows/cross-layer-thinking-guide.md
cat .trellis/structure/guides/index.md
cat .trellis/structure/guides/cross-layer-thinking-guide.md
```

@@ -51,3 +51,3 @@

```bash
./workflow/scripts/feature.sh list
./.trellis/scripts/feature.sh list
```

@@ -88,3 +88,3 @@

|----------|-----------|
| New feature | Run `./workflow/scripts/feature.sh create <name>` |
| New feature | Run `./.trellis/scripts/feature.sh create <name>` |
| Continue feature | Read feature file, continue work |

@@ -91,0 +91,0 @@ | Bug fix | Investigate, fix, then remind user to run `/break-loop` |

@@ -6,3 +6,3 @@ #!/usr/bin/env python3

Core Design Philosophy:
- Router becomes a pure dispatcher, only responsible for "calling subagents"
- Dispatch becomes a pure dispatcher, only responsible for "calling subagents"
- Hook is responsible for injecting all context, subagent works autonomously with complete info

@@ -14,10 +14,10 @@ - Each agent has a dedicated jsonl file defining its context

Context Source: workflow/.current-feature points to feature directory
- coder.jsonl - Coder agent dedicated context
- checker.jsonl - Checker agent dedicated context
- fixer.jsonl - Fixer agent dedicated context
- searcher.jsonl - Searcher agent dedicated context (optional, usually not needed)
- cr.jsonl - Code review dedicated context
- prd.md - Requirements document
- info.md - Technical design
Context Source: .trellis/.current-feature points to feature directory
- implement.jsonl - Implement agent dedicated context
- check.jsonl - Check agent dedicated context
- debug.jsonl - Debug agent dedicated context
- research.jsonl - Research agent dedicated context (optional, usually not needed)
- cr.jsonl - Code review dedicated context
- prd.md - Requirements document
- info.md - Technical design
- codex-review-output.txt - Code Review results

@@ -35,3 +35,3 @@ """

DIR_WORKFLOW = "workflow"
DIR_WORKFLOW = ".trellis"
DIR_PROGRESS = "agent-traces"

@@ -46,11 +46,11 @@ DIR_FEATURES = "features"

AGENT_CODER = "coder"
AGENT_CHECKER = "checker"
AGENT_FIXER = "fixer"
AGENT_SEARCHER = "searcher"
AGENT_IMPLEMENT = "implement"
AGENT_CHECK = "check"
AGENT_DEBUG = "debug"
AGENT_RESEARCH = "research"
# Agents that require a feature directory
AGENTS_REQUIRE_FEATURE = (AGENT_CODER, AGENT_CHECKER, AGENT_FIXER)
AGENTS_REQUIRE_FEATURE = (AGENT_IMPLEMENT, AGENT_CHECK, AGENT_DEBUG)
# All supported agents
AGENTS_ALL = (AGENT_CODER, AGENT_CHECKER, AGENT_FIXER, AGENT_SEARCHER)
AGENTS_ALL = (AGENT_IMPLEMENT, AGENT_CHECK, AGENT_DEBUG, AGENT_RESEARCH)

@@ -75,3 +75,3 @@

"""
Read current feature directory path from workflow/.current-feature
Read current feature directory path from .trellis/.current-feature

@@ -220,8 +220,8 @@ Returns:

def get_coder_context(repo_root: str, feature_dir: str) -> str:
def get_implement_context(repo_root: str, feature_dir: str) -> str:
"""
Complete context for Coder Agent
Complete context for Implement Agent
Read order:
1. All files in coder.jsonl (dev specs)
1. All files in implement.jsonl (dev specs)
2. prd.md (requirements)

@@ -232,4 +232,4 @@ 3. info.md (technical design)

# 1. Read coder.jsonl (or fallback to spec.jsonl)
base_context = get_agent_context(repo_root, feature_dir, "coder")
# 1. Read implement.jsonl (or fallback to spec.jsonl)
base_context = get_agent_context(repo_root, feature_dir, "implement")
if base_context:

@@ -255,8 +255,8 @@ context_parts.append(base_context)

def get_checker_context(repo_root: str, feature_dir: str) -> str:
def get_check_context(repo_root: str, feature_dir: str) -> str:
"""
Complete context for Checker Agent
Complete context for Check Agent
Read order:
1. All files in checker.jsonl (check specs + dev specs)
1. All files in check.jsonl (check specs + dev specs)
2. prd.md (for understanding feature intent)

@@ -266,7 +266,7 @@ """

# 1. Read checker.jsonl (or fallback to spec.jsonl + hardcoded check files)
checker_entries = read_jsonl_entries(repo_root, f"{feature_dir}/checker.jsonl")
# 1. Read check.jsonl (or fallback to spec.jsonl + hardcoded check files)
check_entries = read_jsonl_entries(repo_root, f"{feature_dir}/check.jsonl")
if checker_entries:
for file_path, content in checker_entries:
if check_entries:
for file_path, content in check_entries:
context_parts.append(f"=== {file_path} ===\n{content}")

@@ -301,8 +301,8 @@ else:

def get_fixer_context(repo_root: str, feature_dir: str) -> str:
def get_debug_context(repo_root: str, feature_dir: str) -> str:
"""
Complete context for Fixer Agent
Complete context for Debug Agent
Read order:
1. All files in fixer.jsonl (specs needed for fixing)
1. All files in debug.jsonl (specs needed for fixing)
2. codex-review-output.txt (Codex Review results)

@@ -312,7 +312,7 @@ """

# 1. Read fixer.jsonl (or fallback to spec.jsonl + hardcoded check files)
fixer_entries = read_jsonl_entries(repo_root, f"{feature_dir}/fixer.jsonl")
# 1. Read debug.jsonl (or fallback to spec.jsonl + hardcoded check files)
debug_entries = read_jsonl_entries(repo_root, f"{feature_dir}/debug.jsonl")
if fixer_entries:
for file_path, content in fixer_entries:
if debug_entries:
for file_path, content in debug_entries:
context_parts.append(f"=== {file_path} ===\n{content}")

@@ -347,7 +347,7 @@ else:

def build_coder_prompt(original_prompt: str, context: str) -> str:
"""Build complete prompt for Coder"""
return f"""# Coder Agent Task
def build_implement_prompt(original_prompt: str, context: str) -> str:
"""Build complete prompt for Implement"""
return f"""# Implement Agent Task
You are the Coder Agent in the Multi-Agent Pipeline.
You are the Implement Agent in the Multi-Agent Pipeline.

@@ -382,7 +382,7 @@ ## Your Context

def build_checker_prompt(original_prompt: str, context: str) -> str:
"""Build complete prompt for Checker"""
return f"""# Checker Agent Task
def build_check_prompt(original_prompt: str, context: str) -> str:
"""Build complete prompt for Check"""
return f"""# Check Agent Task
You are the Checker Agent in the Multi-Agent Pipeline (code checker).
You are the Check Agent in the Multi-Agent Pipeline (code and cross-layer checker).

@@ -417,7 +417,7 @@ ## Your Context

def build_fixer_prompt(original_prompt: str, context: str) -> str:
"""Build complete prompt for Fixer"""
return f"""# Fixer Agent Task
def build_debug_prompt(original_prompt: str, context: str) -> str:
"""Build complete prompt for Debug"""
return f"""# Debug Agent Task
You are the Fixer Agent in the Multi-Agent Pipeline (issue fixer).
You are the Debug Agent in the Multi-Agent Pipeline (issue fixer).

@@ -452,9 +452,9 @@ ## Your Context

def get_searcher_context(repo_root: str, feature_dir: str | None) -> str:
def get_research_context(repo_root: str, feature_dir: str | None) -> str:
"""
Context for Searcher Agent
Context for Research Agent
Searcher doesn't need much preset context, only needs:
Research doesn't need much preset context, only needs:
1. Project structure overview (where spec directories are)
2. Optional searcher.jsonl (if there are specific search needs)
2. Optional research.jsonl (if there are specific search needs)
"""

@@ -472,3 +472,3 @@ context_parts = []

├── backend/ # Backend standards
└── flows/ # Thinking guides (cross-layer, code reuse, etc.)
└── guides/ # Thinking guides (cross-layer, code reuse, etc.)

@@ -487,12 +487,12 @@ {DIR_WORKFLOW}/big-question/ # Known issues and pitfalls

# 2. If feature directory exists, try reading searcher.jsonl (optional)
# 2. If feature directory exists, try reading research.jsonl (optional)
if feature_dir:
searcher_entries = read_jsonl_entries(
repo_root, f"{feature_dir}/searcher.jsonl"
research_entries = read_jsonl_entries(
repo_root, f"{feature_dir}/research.jsonl"
)
if searcher_entries:
if research_entries:
context_parts.append(
"\n## Additional Search Context (from searcher.jsonl)\n"
"\n## Additional Search Context (from research.jsonl)\n"
)
for file_path, content in searcher_entries:
for file_path, content in research_entries:
context_parts.append(f"=== {file_path} ===\n{content}")

@@ -503,7 +503,7 @@

def build_searcher_prompt(original_prompt: str, context: str) -> str:
"""Build complete prompt for Searcher"""
return f"""# Searcher Agent Task
def build_research_prompt(original_prompt: str, context: str) -> str:
"""Build complete prompt for Research"""
return f"""# Research Agent Task
You are the Searcher Agent in the Multi-Agent Pipeline (search researcher).
You are the Research Agent in the Multi-Agent Pipeline (search researcher).

@@ -589,6 +589,6 @@ ## Core Principle

# Get current feature directory (searcher doesn't require it)
# Get current feature directory (research doesn't require it)
feature_dir = get_current_feature(repo_root)
# coder/checker/fixer need feature directory
# implement/check/debug need feature directory
if subagent_type in AGENTS_REQUIRE_FEATURE:

@@ -603,18 +603,18 @@ if not feature_dir:

# Get context and build prompt based on subagent type
if subagent_type == AGENT_CODER:
if subagent_type == AGENT_IMPLEMENT:
assert feature_dir is not None # validated above
context = get_coder_context(repo_root, feature_dir)
new_prompt = build_coder_prompt(original_prompt, context)
elif subagent_type == AGENT_CHECKER:
context = get_implement_context(repo_root, feature_dir)
new_prompt = build_implement_prompt(original_prompt, context)
elif subagent_type == AGENT_CHECK:
assert feature_dir is not None # validated above
context = get_checker_context(repo_root, feature_dir)
new_prompt = build_checker_prompt(original_prompt, context)
elif subagent_type == AGENT_FIXER:
context = get_check_context(repo_root, feature_dir)
new_prompt = build_check_prompt(original_prompt, context)
elif subagent_type == AGENT_DEBUG:
assert feature_dir is not None # validated above
context = get_fixer_context(repo_root, feature_dir)
new_prompt = build_fixer_prompt(original_prompt, context)
elif subagent_type == AGENT_SEARCHER:
# Searcher can work without feature directory
context = get_searcher_context(repo_root, feature_dir)
new_prompt = build_searcher_prompt(original_prompt, context)
context = get_debug_context(repo_root, feature_dir)
new_prompt = build_debug_prompt(original_prompt, context)
elif subagent_type == AGENT_RESEARCH:
# Research can work without feature directory
context = get_research_context(repo_root, feature_dir)
new_prompt = build_research_prompt(original_prompt, context)
else:

@@ -621,0 +621,0 @@ sys.exit(0)

@@ -41,3 +41,3 @@ # Agent Progress Index

```bash
./workflow/scripts/init-developer.sh <your-name>
./.trellis/scripts/init-developer.sh <your-name>
```

@@ -55,3 +55,3 @@

```bash
./workflow/scripts/get-developer.sh
./.trellis/scripts/get-developer.sh
```

@@ -61,3 +61,3 @@

```bash
cat workflow/agent-traces/$(./workflow/scripts/get-developer.sh)/index.md
cat .trellis/agent-traces/$(./.trellis/scripts/get-developer.sh)/index.md
```

@@ -64,0 +64,0 @@

@@ -11,4 +11,4 @@ <!-- TRELLIS:START -->

Use `@/workflow/` to learn:
- Development workflow (`flow.md`)
Use `@/.trellis/` to learn:
- Development workflow (`workflow.md`)
- Project structure guidelines (`structure/`)

@@ -15,0 +15,0 @@ - Progress tracking (`agent-traces/`)

@@ -6,3 +6,3 @@ /**

export declare const agentProgressIndexContent: string;
export declare const flowMdContent: string;
export declare const workflowMdContent: string;
export declare const workflowGitignoreContent: string;

@@ -24,5 +24,5 @@ export declare const initAgentContent: string;

export declare const frontendStateManagementContent: string;
export declare const flowsIndexContent: string;
export declare const flowsCrossLayerThinkingGuideContent: string;
export declare const flowsCodeReuseThinkingGuideContent: string;
export declare const guidesIndexContent: string;
export declare const guidesCrossLayerThinkingGuideContent: string;
export declare const guidesCodeReuseThinkingGuideContent: string;
//# sourceMappingURL=index.d.ts.map

@@ -1,1 +0,1 @@

{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/templates/markdown/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,eAAO,MAAM,yBAAyB,EAAE,MAEvC,CAAC;AAGF,eAAO,MAAM,aAAa,EAAE,MAAoC,CAAC;AACjE,eAAO,MAAM,wBAAwB,EAAE,MAAsC,CAAC;AAG9E,eAAO,MAAM,gBAAgB,EAAE,MAA0C,CAAC;AAC1E,eAAO,MAAM,eAAe,EAAE,MAAsC,CAAC;AAGrE,eAAO,MAAM,mBAAmB,EAAE,MAEjC,CAAC;AACF,eAAO,MAAM,gCAAgC,EAAE,MAE9C,CAAC;AACF,eAAO,MAAM,gCAAgC,EAAE,MAE9C,CAAC;AACF,eAAO,MAAM,+BAA+B,EAAE,MAE7C,CAAC;AACF,eAAO,MAAM,+BAA+B,EAAE,MAE7C,CAAC;AACF,eAAO,MAAM,2BAA2B,EAAE,MAEzC,CAAC;AAGF,eAAO,MAAM,oBAAoB,EAAE,MAElC,CAAC;AACF,eAAO,MAAM,iCAAiC,EAAE,MAE/C,CAAC;AACF,eAAO,MAAM,yBAAyB,EAAE,MAEvC,CAAC;AACF,eAAO,MAAM,6BAA6B,EAAE,MAE3C,CAAC;AACF,eAAO,MAAM,kCAAkC,EAAE,MAEhD,CAAC;AACF,eAAO,MAAM,gCAAgC,EAAE,MAE9C,CAAC;AACF,eAAO,MAAM,8BAA8B,EAAE,MAE5C,CAAC;AAGF,eAAO,MAAM,iBAAiB,EAAE,MAE/B,CAAC;AACF,eAAO,MAAM,mCAAmC,EAAE,MAEjD,CAAC;AACF,eAAO,MAAM,kCAAkC,EAAE,MAEhD,CAAC"}
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/templates/markdown/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,eAAO,MAAM,yBAAyB,EAAE,MAEvC,CAAC;AAGF,eAAO,MAAM,iBAAiB,EAAE,MAAwC,CAAC;AACzE,eAAO,MAAM,wBAAwB,EAAE,MAAsC,CAAC;AAG9E,eAAO,MAAM,gBAAgB,EAAE,MAA0C,CAAC;AAC1E,eAAO,MAAM,eAAe,EAAE,MAAsC,CAAC;AAGrE,eAAO,MAAM,mBAAmB,EAAE,MAEjC,CAAC;AACF,eAAO,MAAM,gCAAgC,EAAE,MAE9C,CAAC;AACF,eAAO,MAAM,gCAAgC,EAAE,MAE9C,CAAC;AACF,eAAO,MAAM,+BAA+B,EAAE,MAE7C,CAAC;AACF,eAAO,MAAM,+BAA+B,EAAE,MAE7C,CAAC;AACF,eAAO,MAAM,2BAA2B,EAAE,MAEzC,CAAC;AAGF,eAAO,MAAM,oBAAoB,EAAE,MAElC,CAAC;AACF,eAAO,MAAM,iCAAiC,EAAE,MAE/C,CAAC;AACF,eAAO,MAAM,yBAAyB,EAAE,MAEvC,CAAC;AACF,eAAO,MAAM,6BAA6B,EAAE,MAE3C,CAAC;AACF,eAAO,MAAM,kCAAkC,EAAE,MAEhD,CAAC;AACF,eAAO,MAAM,gCAAgC,EAAE,MAE9C,CAAC;AACF,eAAO,MAAM,8BAA8B,EAAE,MAE5C,CAAC;AAGF,eAAO,MAAM,kBAAkB,EAAE,MAEhC,CAAC;AACF,eAAO,MAAM,oCAAoC,EAAE,MAElD,CAAC;AACF,eAAO,MAAM,mCAAmC,EAAE,MAEjD,CAAC"}

@@ -8,4 +8,4 @@ /**

export const agentProgressIndexContent = readMarkdown("agent-traces-index.md.txt");
// Flow documentation
export const flowMdContent = readMarkdown("flow.md.txt");
// Workflow documentation
export const workflowMdContent = readMarkdown("workflow.md.txt");
export const workflowGitignoreContent = readMarkdown("gitignore.txt");

@@ -30,6 +30,6 @@ // Root files

export const frontendStateManagementContent = readMarkdown("structure/frontend/state-management.md.txt");
// Flows structure
export const flowsIndexContent = readMarkdown("structure/flows/index.md.txt");
export const flowsCrossLayerThinkingGuideContent = readMarkdown("structure/flows/cross-layer-thinking-guide.md.txt");
export const flowsCodeReuseThinkingGuideContent = readMarkdown("structure/flows/code-reuse-thinking-guide.md.txt");
// Guides structure
export const guidesIndexContent = readMarkdown("structure/guides/index.md.txt");
export const guidesCrossLayerThinkingGuideContent = readMarkdown("structure/guides/cross-layer-thinking-guide.md.txt");
export const guidesCodeReuseThinkingGuideContent = readMarkdown("structure/guides/code-reuse-thinking-guide.md.txt");
//# sourceMappingURL=index.js.map

@@ -1,1 +0,1 @@

{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/templates/markdown/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,iBAAiB;AACjB,MAAM,CAAC,MAAM,yBAAyB,GAAW,YAAY,CAC3D,2BAA2B,CAC5B,CAAC;AAEF,qBAAqB;AACrB,MAAM,CAAC,MAAM,aAAa,GAAW,YAAY,CAAC,aAAa,CAAC,CAAC;AACjE,MAAM,CAAC,MAAM,wBAAwB,GAAW,YAAY,CAAC,eAAe,CAAC,CAAC;AAE9E,aAAa;AACb,MAAM,CAAC,MAAM,gBAAgB,GAAW,YAAY,CAAC,mBAAmB,CAAC,CAAC;AAC1E,MAAM,CAAC,MAAM,eAAe,GAAW,YAAY,CAAC,eAAe,CAAC,CAAC;AAErE,uCAAuC;AACvC,MAAM,CAAC,MAAM,mBAAmB,GAAW,YAAY,CACrD,gCAAgC,CACjC,CAAC;AACF,MAAM,CAAC,MAAM,gCAAgC,GAAW,YAAY,CAClE,8CAA8C,CAC/C,CAAC;AACF,MAAM,CAAC,MAAM,gCAAgC,GAAW,YAAY,CAClE,8CAA8C,CAC/C,CAAC;AACF,MAAM,CAAC,MAAM,+BAA+B,GAAW,YAAY,CACjE,6CAA6C,CAC9C,CAAC;AACF,MAAM,CAAC,MAAM,+BAA+B,GAAW,YAAY,CACjE,6CAA6C,CAC9C,CAAC;AACF,MAAM,CAAC,MAAM,2BAA2B,GAAW,YAAY,CAC7D,yCAAyC,CAC1C,CAAC;AAEF,wCAAwC;AACxC,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ialized
./workflow/scripts/get-developer.sh
./.trellis/scripts/get-developer.sh
# If not initialized, run:
./workflow/scripts/init-developer.sh <your-name>
# Example: ./workflow/scripts/init-developer.sh cursor-agent
./.trellis/scripts/init-developer.sh <your-name>
# Example: ./.trellis/scripts/init-developer.sh cursor-agent
```
This creates:
- `workflow/.developer` - Your identity file (gitignored, not committed)
- `workflow/agent-traces/<your-name>/` - Your personal progress directory
- `.trellis/.developer` - Your identity file (gitignored, not committed)
- `.trellis/agent-traces/<your-name>/` - Your personal progress directory

@@ -36,7 +36,7 @@ **Naming suggestions**:

# Get full context in one command
./workflow/scripts/get-context.sh
./.trellis/scripts/get-context.sh
# Or check manually:
./workflow/scripts/get-developer.sh # Your identity
./workflow/scripts/feature.sh list # Active features
./.trellis/scripts/get-developer.sh # Your identity
./.trellis/scripts/feature.sh list # Active features
git status && git log --oneline -10 # Git state

@@ -51,6 +51,6 @@ ```

# Read frontend guidelines index (REQUIRED - even for backend tasks)
cat workflow/structure/frontend/index.md
cat .trellis/structure/frontend/index.md
# Read backend guidelines index (REQUIRED - even for frontend tasks)
cat workflow/structure/backend/index.md
cat .trellis/structure/backend/index.md
```

@@ -67,3 +67,3 @@

```bash
cat workflow/flow.md
cat .trellis/workflow.md
```

@@ -79,5 +79,5 @@

```bash
cat workflow/structure/frontend/hook-guidelines.md # For hooks
cat workflow/structure/frontend/component-guidelines.md # For components
cat workflow/structure/frontend/type-safety.md # For types
cat .trellis/structure/frontend/hook-guidelines.md # For hooks
cat .trellis/structure/frontend/component-guidelines.md # For components
cat .trellis/structure/frontend/type-safety.md # For types
```

@@ -87,5 +87,5 @@

```bash
cat workflow/structure/backend/database-guidelines.md # For DB operations
cat workflow/structure/backend/type-safety.md # For Zod/types
cat workflow/structure/backend/logging-guidelines.md # For logging
cat .trellis/structure/backend/database-guidelines.md # For DB operations
cat .trellis/structure/backend/type-safety.md # For Zod/types
cat .trellis/structure/backend/logging-guidelines.md # For logging
```

@@ -118,4 +118,4 @@

your-project/
├── workflow/ # [!] Agent-Human collaboration system
│ ├── flow.md # Workflow guide (MUST READ)
├── .trellis/ # [!] Agent-Human collaboration system
│ ├── workflow.md # Workflow guide (MUST READ)
│ ├── scripts/ # Workflow scripts

@@ -139,3 +139,3 @@ │ │ ├── common/ # Shared utilities

│ │ │ └── *.md # Topic-specific docs
│ │ └── flows/ # Cross-layer specs
│ │ └── guides/ # Thinking guides
├── init-agent.md # This initialization guide

@@ -157,5 +157,5 @@ └── AGENTS.md # Compatible with agents.md protocol

|------|---------|----------------|
| `workflow/flow.md` | Complete workflow guide | Read at session start |
| `workflow/agent-traces/{developer}/features/` | Feature tracking | When creating/completing features |
| `workflow/agent-traces/{developer}/progress-N.md` | Session work records | After each session |
| `.trellis/workflow.md` | Complete workflow guide | Read at session start |
| `.trellis/agent-traces/{developer}/features/` | Feature tracking | When creating/completing features |
| `.trellis/agent-traces/{developer}/progress-N.md` | Session work records | After each session |

@@ -165,4 +165,4 @@ ### Key Rules (CRITICAL - Must Follow)

**1. Read Guidelines Before Coding**
- Frontend: `workflow/structure/frontend/index.md` -> specific docs
- Backend: `workflow/structure/backend/index.md` -> specific docs
- Frontend: `.trellis/structure/frontend/index.md` -> specific docs
- Backend: `.trellis/structure/backend/index.md` -> specific docs
- This is **mandatory**, not optional

@@ -185,6 +185,6 @@

1. **Get context** - Run `./workflow/scripts/get-context.sh`
1. **Get context** - Run `./.trellis/scripts/get-context.sh`
2. **Read ALL guideline indexes** (see Quick Start Step 2 above)
- **MANDATORY**: Read both frontend AND backend indexes
3. **Read workflow guide** - `cat workflow/flow.md`
3. **Read workflow guide** - `cat .trellis/workflow.md`
4. **Identify your task** from feature list

@@ -198,3 +198,3 @@ 5. **Read specific guidelines** for your task

```bash
./workflow/scripts/feature.sh create <feature-name>
./.trellis/scripts/feature.sh create <feature-name>
```

@@ -222,3 +222,3 @@

```bash
./workflow/scripts/add-session.sh \
./.trellis/scripts/add-session.sh \
--title "Session Title" \

@@ -236,3 +236,3 @@ --commit "abc1234" \

```bash
./workflow/scripts/feature.sh archive <feature-name>
./.trellis/scripts/feature.sh archive <feature-name>
```

@@ -246,9 +246,9 @@

```bash
./workflow/scripts/get-context.sh # Get full context
./workflow/scripts/get-developer.sh # Get current developer
./workflow/scripts/init-developer.sh <name> # Initialize developer
./workflow/scripts/feature.sh list # List features
./workflow/scripts/feature.sh create <name> # Create feature
./workflow/scripts/feature.sh archive <name># Archive feature
./workflow/scripts/add-session.sh # Record session
./.trellis/scripts/get-context.sh # Get full context
./.trellis/scripts/get-developer.sh # Get current developer
./.trellis/scripts/init-developer.sh <name> # Initialize developer
./.trellis/scripts/feature.sh list # List features
./.trellis/scripts/feature.sh create <name> # Create feature
./.trellis/scripts/feature.sh archive <name># Archive feature
./.trellis/scripts/add-session.sh # Record session
```

@@ -279,3 +279,3 @@

1. **Read BOTH guideline indexes** at session start (frontend AND backend)
2. **Read workflow/flow.md** at session start
2. **Read .trellis/workflow.md** at session start
3. **Read specific docs** before coding (based on task)

@@ -302,5 +302,5 @@ 4. **Update tracking files** after work

- [ ] Run `./workflow/scripts/get-context.sh` - Understand context
- [ ] Read `workflow/flow.md` - Understand the workflow
- [ ] Read `workflow/structure/[frontend|backend]/index.md` - Find relevant guidelines
- [ ] Run `./.trellis/scripts/get-context.sh` - Understand context
- [ ] Read `.trellis/workflow.md` - Understand the workflow
- [ ] Read `.trellis/structure/[frontend|backend]/index.md` - Find relevant guidelines
- [ ] Read specific guideline docs based on your task

@@ -307,0 +307,0 @@ - [ ] Create or select a feature with `feature.sh`

@@ -5,4 +5,4 @@ #!/bin/bash

# Usage:
# ./workflow/scripts/add-session.sh --title "Title" --commit "hash" --summary "Summary"
# echo "content" | ./workflow/scripts/add-session.sh --title "Title" --commit "hash"
# ./.trellis/scripts/add-session.sh --title "Title" --commit "hash" --summary "Summary"
# echo "content" | ./.trellis/scripts/add-session.sh --title "Title" --commit "hash"

@@ -9,0 +9,0 @@ set -e

@@ -114,3 +114,3 @@ #!/bin/bash

echo "Error: Developer not initialized." >&2
echo "Run: ./workflow/scripts/init-developer.sh <your-name>" >&2
echo "Run: ./.trellis/scripts/init-developer.sh <your-name>" >&2
exit 1

@@ -117,0 +117,0 @@ fi

@@ -5,4 +5,4 @@ #!/bin/bash

# Usage:
# ./workflow/scripts/common/git-context.sh # Full context output
# ./workflow/scripts/common/git-context.sh --json # JSON format
# ./.trellis/scripts/common/git-context.sh # Full context output
# ./.trellis/scripts/common/git-context.sh --json # JSON format
#

@@ -9,0 +9,0 @@ # Or source in other scripts:

@@ -19,3 +19,3 @@ #!/bin/bash

# Directory names
DIR_WORKFLOW="workflow"
DIR_WORKFLOW=".trellis"
DIR_PROGRESS="agent-traces"

@@ -37,3 +37,3 @@ DIR_FEATURES="features"

get_repo_root() {
# Find the nearest directory containing workflow/ folder
# Find the nearest directory containing .trellis/ folder
# This handles nested git repos correctly (e.g., test project inside another repo)

@@ -50,3 +50,3 @@ local current="$PWD"

# Fallback to current directory if no workflow/ found
# Fallback to current directory if no .trellis/ found
echo "$PWD"

@@ -53,0 +53,0 @@ }

@@ -8,3 +8,3 @@ #!/bin/bash

# Usage:
# ./workflow/scripts/create-bootstrap.sh [project-type]
# ./.trellis/scripts/create-bootstrap.sh [project-type]
#

@@ -15,6 +15,6 @@ # Arguments:

# Prerequisites:
# - workflow/.developer must exist (run init-developer.sh first)
# - .trellis/.developer must exist (run init-developer.sh first)
#
# Creates:
# workflow/agent-traces/{developer}/features/00-bootstrap-guidelines/
# .trellis/agent-traces/{developer}/features/00-bootstrap-guidelines/
# ├── feature.json # Feature metadata

@@ -63,3 +63,3 @@ # └── prd.md # Task description and guidance

AI agents use `workflow/structure/` to understand YOUR project's coding conventions.
AI agents use `.trellis/structure/` to understand YOUR project's coding conventions.
**Empty templates = AI writes generic code that doesn't match your project style.**

@@ -84,7 +84,7 @@

|------|------------------|
| `workflow/structure/backend/directory-structure.md` | Where different file types go (routes, services, utils) |
| `workflow/structure/backend/database-guidelines.md` | ORM, migrations, query patterns, naming conventions |
| `workflow/structure/backend/error-handling.md` | How errors are caught, logged, and returned |
| `workflow/structure/backend/logging-guidelines.md` | Log levels, format, what to log |
| `workflow/structure/backend/quality-guidelines.md` | Code review standards, testing requirements |
| `.trellis/structure/backend/directory-structure.md` | Where different file types go (routes, services, utils) |
| `.trellis/structure/backend/database-guidelines.md` | ORM, migrations, query patterns, naming conventions |
| `.trellis/structure/backend/error-handling.md` | How errors are caught, logged, and returned |
| `.trellis/structure/backend/logging-guidelines.md` | Log levels, format, what to log |
| `.trellis/structure/backend/quality-guidelines.md` | Code review standards, testing requirements |
EOF

@@ -100,8 +100,8 @@ }

|------|------------------|
| `workflow/structure/frontend/directory-structure.md` | Component/page/hook organization |
| `workflow/structure/frontend/component-guidelines.md` | Component patterns, props conventions |
| `workflow/structure/frontend/hook-guidelines.md` | Custom hook naming, patterns |
| `workflow/structure/frontend/state-management.md` | State library, patterns, what goes where |
| `workflow/structure/frontend/type-safety.md` | TypeScript conventions, type organization |
| `workflow/structure/frontend/quality-guidelines.md` | Linting, testing, accessibility |
| `.trellis/structure/frontend/directory-structure.md` | Component/page/hook organization |
| `.trellis/structure/frontend/component-guidelines.md` | Component patterns, props conventions |
| `.trellis/structure/frontend/hook-guidelines.md` | Custom hook naming, patterns |
| `.trellis/structure/frontend/state-management.md` | State library, patterns, what goes where |
| `.trellis/structure/frontend/type-safety.md` | TypeScript conventions, type organization |
| `.trellis/structure/frontend/quality-guidelines.md` | Linting, testing, accessibility |
EOF

@@ -115,3 +115,3 @@ }

The `workflow/structure/flows/` directory contains thinking guides that are already
The `.trellis/structure/guides/` directory contains thinking guides that are already
filled with general best practices. You can customize them for your project if needed.

@@ -158,4 +158,4 @@

```bash
./workflow/scripts/feature.sh finish
./workflow/scripts/feature.sh archive 00-bootstrap-guidelines
./.trellis/scripts/feature.sh finish
./.trellis/scripts/feature.sh archive 00-bootstrap-guidelines
```

@@ -221,3 +221,3 @@

related_files='[
"workflow/structure/frontend/"
".trellis/structure/frontend/"
]'

@@ -231,3 +231,3 @@ ;;

related_files='[
"workflow/structure/backend/"
".trellis/structure/backend/"
]'

@@ -242,4 +242,4 @@ ;;

related_files='[
"workflow/structure/backend/",
"workflow/structure/frontend/"
".trellis/structure/backend/",
".trellis/structure/frontend/"
]'

@@ -303,18 +303,7 @@ ;;

echo -e "${GREEN}Bootstrap feature created!${NC}"
echo ""
echo -e "Location: ${BLUE}$relative_path${NC}"
echo ""
echo -e "${YELLOW}Your first task:${NC}"
echo " Fill in the project guidelines in workflow/structure/"
echo " This helps AI understand YOUR project's coding conventions."
echo ""
echo -e "${BLUE}Next steps:${NC}"
echo " 1. Run /start to begin your AI session"
echo " 2. Read prd.md for detailed instructions"
echo " 3. Ask AI to help analyze your codebase"
echo ""
echo -e "When done: ${GREEN}./workflow/scripts/feature.sh archive $FEATURE_NAME${NC}"
# Silent output - init command handles user-facing messages
# Only output the feature path for programmatic use
echo "$relative_path"
}
main "$@"

@@ -5,12 +5,12 @@ #!/bin/bash

# Usage:
# ./workflow/scripts/feature.sh create <feature-name> # Create new feature
# ./workflow/scripts/feature.sh init-context <dir> <type> # Initialize jsonl files
# ./workflow/scripts/feature.sh add-context <dir> <file> <path> [reason] # Add jsonl entry
# ./workflow/scripts/feature.sh validate <dir> # Validate jsonl files
# ./workflow/scripts/feature.sh list-context <dir> # List jsonl entries
# ./workflow/scripts/feature.sh start <dir> # Set as current feature
# ./workflow/scripts/feature.sh finish # Clear current feature
# ./workflow/scripts/feature.sh archive <feature-name> # Archive completed feature
# ./workflow/scripts/feature.sh list # List active features
# ./workflow/scripts/feature.sh list-archive [month] # List archived features
# ./.trellis/scripts/feature.sh create <feature-name> # Create new feature
# ./.trellis/scripts/feature.sh init-context <dir> <type> # Initialize jsonl files
# ./.trellis/scripts/feature.sh add-context <dir> <file> <path> [reason] # Add jsonl entry
# ./.trellis/scripts/feature.sh validate <dir> # Validate jsonl files
# ./.trellis/scripts/feature.sh list-context <dir> # List jsonl entries
# ./.trellis/scripts/feature.sh start <dir> # Set as current feature
# ./.trellis/scripts/feature.sh finish # Clear current feature
# ./.trellis/scripts/feature.sh archive <feature-name> # Archive completed feature
# ./.trellis/scripts/feature.sh list # List active features
# ./.trellis/scripts/feature.sh list-archive [month] # List archived features
#

@@ -23,5 +23,5 @@ # Feature Directory Structure:

# │ ├── info.md # Technical design (optional)
# │ ├── coder.jsonl # Coder agent context
# │ ├── checker.jsonl # Checker agent context
# │ └── fixer.jsonl # Fixer agent context
# │ ├── implement.jsonl # Implement agent context
# │ ├── check.jsonl # Check agent context
# │ └── debug.jsonl # Debug agent context
# └── archive/

@@ -51,5 +51,5 @@ # └── 2026-01/

get_coder_base() {
get_implement_base() {
cat << EOF
{"file": "$DIR_WORKFLOW/flow.md", "reason": "Project workflow and conventions"}
{"file": "$DIR_WORKFLOW/workflow.md", "reason": "Project workflow and conventions"}
{"file": "$DIR_WORKFLOW/$DIR_STRUCTURE/shared/index.md", "reason": "Shared coding standards"}

@@ -59,3 +59,3 @@ EOF

get_coder_backend() {
get_implement_backend() {
cat << EOF

@@ -68,3 +68,3 @@ {"file": "$DIR_WORKFLOW/$DIR_STRUCTURE/backend/index.md", "reason": "Backend development guide"}

get_coder_frontend() {
get_implement_frontend() {
cat << EOF

@@ -76,3 +76,3 @@ {"file": "$DIR_WORKFLOW/$DIR_STRUCTURE/frontend/index.md", "reason": "Frontend development guide"}

get_checker_context() {
get_check_context() {
local dev_type="$1"

@@ -93,3 +93,3 @@

get_fixer_context() {
get_debug_context() {
local dev_type="$1"

@@ -218,29 +218,29 @@

# coder.jsonl
echo -e "${CYAN}Creating coder.jsonl...${NC}"
local coder_file="$target_dir/coder.jsonl"
# implement.jsonl
echo -e "${CYAN}Creating implement.jsonl...${NC}"
local implement_file="$target_dir/implement.jsonl"
{
get_coder_base
get_implement_base
case "$dev_type" in
backend|test) get_coder_backend ;;
frontend) get_coder_frontend ;;
backend|test) get_implement_backend ;;
frontend) get_implement_frontend ;;
fullstack)
get_coder_backend
get_coder_frontend
get_implement_backend
get_implement_frontend
;;
esac
} > "$coder_file"
echo -e " ${GREEN}✓${NC} $(wc -l < "$coder_file" | tr -d ' ') entries"
} > "$implement_file"
echo -e " ${GREEN}✓${NC} $(wc -l < "$implement_file" | tr -d ' ') entries"
# checker.jsonl
echo -e "${CYAN}Creating checker.jsonl...${NC}"
local checker_file="$target_dir/checker.jsonl"
get_checker_context "$dev_type" > "$checker_file"
echo -e " ${GREEN}✓${NC} $(wc -l < "$checker_file" | tr -d ' ') entries"
# check.jsonl
echo -e "${CYAN}Creating check.jsonl...${NC}"
local check_file="$target_dir/check.jsonl"
get_check_context "$dev_type" > "$check_file"
echo -e " ${GREEN}✓${NC} $(wc -l < "$check_file" | tr -d ' ') entries"
# fixer.jsonl
echo -e "${CYAN}Creating fixer.jsonl...${NC}"
local fixer_file="$target_dir/fixer.jsonl"
get_fixer_context "$dev_type" > "$fixer_file"
echo -e " ${GREEN}✓${NC} $(wc -l < "$fixer_file" | tr -d ' ') entries"
# debug.jsonl
echo -e "${CYAN}Creating debug.jsonl...${NC}"
local debug_file="$target_dir/debug.jsonl"
get_debug_context "$dev_type" > "$debug_file"
echo -e " ${GREEN}✓${NC} $(wc -l < "$debug_file" | tr -d ' ') entries"

@@ -268,3 +268,3 @@ echo ""

echo "Usage: $0 add-context <feature-dir> <jsonl-file> <path> [reason]"
echo " jsonl-file: coder | checker | fixer (or full filename)"
echo " jsonl-file: implement | check | debug (or full filename)"
exit 1

@@ -385,3 +385,3 @@ fi

local total_errors=0
for jsonl_file in "$target_dir"/{coder,checker,fixer}.jsonl; do
for jsonl_file in "$target_dir"/{implement,check,debug}.jsonl; do
validate_jsonl "$jsonl_file"

@@ -419,3 +419,3 @@ total_errors=$((total_errors + $?))

for jsonl_file in "$target_dir"/{coder,checker,fixer}.jsonl; do
for jsonl_file in "$target_dir"/{implement,check,debug}.jsonl; do
local file_name=$(basename "$jsonl_file")

@@ -661,5 +661,5 @@ [[ ! -f "$jsonl_file" ]] && continue

$0 create add-login-feature
$0 init-context workflow/agent-traces/john/features/13-add-login-feature backend
$0 add-context <dir> coder workflow/structure/backend/auth.md "Auth guidelines"
$0 start workflow/agent-traces/john/features/13-add-login-feature
$0 init-context .trellis/agent-traces/john/features/13-add-login-feature backend
$0 add-context <dir> implement .trellis/structure/backend/auth.md "Auth guidelines"
$0 start .trellis/agent-traces/john/features/13-add-login-feature
$0 finish

@@ -666,0 +666,0 @@ $0 archive add-login-feature

@@ -5,7 +5,7 @@ #!/bin/bash

# Usage:
# ./workflow/scripts/init-developer.sh <developer-name>
# ./.trellis/scripts/init-developer.sh <developer-name>
#
# This creates:
# - workflow/.developer file with developer info
# - workflow/agent-traces/<name>/ directory structure
# - .trellis/.developer file with developer info
# - .trellis/agent-traces/<name>/ directory structure

@@ -12,0 +12,0 @@ set -e

{
"name": "@mind-fold/trellis",
"version": "0.1.1",
"version": "0.1.2",
"description": "AI capabilities grow like ivy — Trellis provides the structure to guide them along a disciplined path",

@@ -15,17 +15,2 @@ "type": "module",

},
"scripts": {
"build": "tsc && pnpm run copy-templates",
"copy-templates": "node scripts/copy-templates.js",
"dev": "tsc --watch",
"start": "node ./dist/cli/index.js",
"lint": "eslint src/",
"lint:fix": "eslint src/ --fix",
"format": "prettier --write src/",
"format:check": "prettier --check src/",
"typecheck": "tsc --noEmit",
"prepublishOnly": "pnpm run build",
"release": "git add -A && git diff-index --quiet HEAD || git commit -m 'chore: pre-release updates' && pnpm version patch && git push origin main --tags",
"release:minor": "git add -A && git diff-index --quiet HEAD || git commit -m 'chore: pre-release updates' && pnpm version minor && git push origin main --tags",
"release:major": "git add -A && git diff-index --quiet HEAD || git commit -m 'chore: pre-release updates' && pnpm version major && git push origin main --tags"
},
"keywords": [

@@ -47,2 +32,3 @@ "ai",

"commander": "^12.1.0",
"figlet": "^1.9.4",
"inquirer": "^9.3.7"

@@ -52,2 +38,3 @@ },

"@eslint/js": "^9.18.0",
"@types/figlet": "^1.7.0",
"@types/inquirer": "^9.0.7",

@@ -72,3 +59,17 @@ "@types/node": "^20.17.10",

"url": "https://github.com/mindfold-ai/trellis.git"
},
"scripts": {
"build": "tsc && pnpm run copy-templates",
"copy-templates": "node scripts/copy-templates.js",
"dev": "tsc --watch",
"start": "node ./dist/cli/index.js",
"lint": "eslint src/",
"lint:fix": "eslint src/ --fix",
"format": "prettier --write src/",
"format:check": "prettier --check src/",
"typecheck": "tsc --noEmit",
"release": "git add -A && git diff-index --quiet HEAD || git commit -m 'chore: pre-release updates' && pnpm version patch && git push origin main --tags",
"release:minor": "git add -A && git diff-index --quiet HEAD || git commit -m 'chore: pre-release updates' && pnpm version minor && git push origin main --tags",
"release:major": "git add -A && git diff-index --quiet HEAD || git commit -m 'chore: pre-release updates' && pnpm version major && git push origin main --tags"
}
}
}

@@ -40,5 +40,5 @@ # Trellis

your-project/
├── workflow/
├── .trellis/
│ ├── .developer # Developer identity (gitignored)
│ ├── flow.md # Workflow guide
│ ├── workflow.md # Workflow guide
│ ├── agent-traces/ # Session tracking

@@ -55,3 +55,3 @@ │ │ └── {developer}/ # Per-developer progress

│ │ ├── backend/ # Backend standards
│ │ └── flows/ # Thinking guides
│ │ └── guides/ # Thinking guides
│ └── scripts/ # Utility scripts

@@ -80,3 +80,3 @@ │ ├── common/ # Shared utilities

```bash
./workflow/scripts/init-developer.sh <name>
./.trellis/scripts/init-developer.sh <name>
```

@@ -114,5 +114,5 @@

```bash
./workflow/scripts/feature.sh create my-feature # Create feature
./workflow/scripts/feature.sh list # List active features
./workflow/scripts/feature.sh archive my-feature # Archive completed
./.trellis/scripts/feature.sh create my-feature # Create feature
./.trellis/scripts/feature.sh list # List active features
./.trellis/scripts/feature.sh archive my-feature # Archive completed
```

@@ -133,4 +133,4 @@

1. **AI reads `init-agent.md`** at session start
2. **Follows guidelines** in `workflow/structure/`
3. **Updates progress** in `workflow/agent-traces/`
2. **Follows guidelines** in `.trellis/structure/`
3. **Updates progress** in `.trellis/agent-traces/`
4. **Uses slash commands** for common tasks

@@ -137,0 +137,0 @@

---
name: checker
description: |
Code self-check expert. Hook auto-injects all check specs and dev specs.
After receiving context: get diff → check against specs → self-fix issues.
Fix issues yourself, not just report them.
tools: Read, Write, Edit, Bash, Glob, Grep, mcp__exa__web_search_exa, mcp__exa__get_code_context_exa
model: opus
---
# Checker Agent
You are the Checker Agent in the Multi-Agent Pipeline.
## Context Auto-Injected
> **Important**: Hook has automatically injected the following into your context:
>
> - All check specs and dev specs (defined in checker.jsonl)
> - Requirements document (for understanding feature intent)
>
> Typically includes: finish-work.md, check-*.md, quality.md, etc.
> You don't need to manually read these files, just refer to the injected context.
## Core Responsibilities
1. **Get code changes** - Use git diff to get uncommitted code
2. **Check against specs** - Refer to check specs in context
3. **Self-fix** - Fix issues yourself, not just report them
4. **Run verification** - typecheck and lint
## Important
**Fix issues yourself**, don't just report to Router.
You have Write and Edit tools, you can modify code directly.
---
## Workflow
### Step 1: Get Changes
```bash
git diff --name-only # List changed files
git diff # View specific changes
```
### Step 2: Check Against Specs
Refer to injected specs in context to check code:
- Does it follow directory structure conventions
- Does it follow naming conventions
- Does it follow code patterns
- Are there missing types
- Are there potential bugs
**Pay special attention to finish-work.md checklist**:
- Impact radius analysis (L1-L5)
- Documentation sync check
- Interface completeness
- Cross-layer verification
### Step 3: Self-Fix
After finding issues:
1. Fix the issue directly (use Edit tool)
2. Record what was fixed
3. Continue checking other issues
### Step 4: Run Verification
Reference `.husky/pre-commit` verification logic:
```bash
cat .husky/pre-commit
```
Execute checks according to the script. If failed, fix issues and re-run.
---
## Report Format
```markdown
## Self-Check Complete
### Files Checked
- src/components/Feature.tsx
- src/hooks/useFeature.ts
- src/services/feature/procedures/create.ts
### Issues Found and Fixed
1. ✅ `src/components/Feature.tsx:25` - Missing return type, added
2. ✅ `src/hooks/useFeature.ts:12` - Unused import, removed
3. ✅ `src/services/feature/procedures/create.ts:8` - Timestamp used seconds, changed to milliseconds
### Impact Radius Analysis
- L2 module-level change: Added useFeature hook
- No documentation update needed (not L3+ change)
### Issues Not Fixed
(If there are issues that cannot be self-fixed, list them here with reasons)
### Verification Results
- TypeCheck: ✅ Passed
- Lint: ✅ Passed
### Summary
Checked 3 files, found 3 issues, all fixed.
```
---
name: coder
description: |
Code writing expert. Hook auto-injects all specs, requirements, and technical docs.
After receiving context: understand specs → understand requirements → implement.
No git commit allowed, only code modifications.
tools: Read, Write, Edit, Bash, Glob, Grep, mcp__exa__web_search_exa, mcp__exa__get_code_context_exa
model: opus
---
# Coder Agent
You are the Coder Agent in the Multi-Agent Pipeline.
## Context Auto-Injected
> **Important**: Hook has automatically injected the following into your context:
>
> - Project base info (workflow/flow.md)
> - All development specs (defined in coder.jsonl)
> - Requirements document (prd.md)
> - Technical design (info.md)
>
> You don't need to manually read these files, just refer to the injected context.
## Core Responsibilities
1. **Understand specs** - Refer to injected spec files
2. **Understand requirements** - Refer to prd.md and info.md in context
3. **Implement features** - Write code following specs and design
4. **Self-check** - Ensure code quality against check specs
5. **Report results** - Report completion status to Router
## Forbidden Operations
**Do NOT execute these git commands:**
- `git commit`
- `git push`
- `git merge`
Only Router Agent can execute git commit at the final stage.
---
## Workflow
### 1. Understand Specs
All specs are injected in context, read and understand:
- Directory structure conventions
- Naming conventions
- Code patterns
### 2. Understand Requirements
prd.md and info.md are injected in context:
- What are the core requirements
- Key points of technical design
- Which files to modify/create
### 3. Implement Features
- Write code following specs and technical design
- Follow existing code patterns
- Only do what's required, no over-engineering
### 4. Verify
Reference `.husky/pre-commit` for verification:
```bash
cat .husky/pre-commit
```
Execute checks according to the script.
---
## Report Format
```markdown
## Implementation Complete
### Files Modified
- `src/components/Feature.tsx` - New component
- `src/hooks/useFeature.ts` - New hook
- `src/services/feature/procedures/create.ts` - Modified
### Implementation Summary
1. Created Feature component...
2. Added useFeature hook...
### Verification Results
✅ Verified against .husky/pre-commit
```
---
## Code Standards
Follow all spec files injected in context.
General principles:
- Follow existing code patterns
- Don't add unnecessary abstractions
- Only do what's required, no over-engineering
- Keep code readable
---
name: fixer
description: |
Issue fixing expert. Hook auto-injects dev specs and code review output.
After receiving context: understand issues → fix against specs → verify fixes.
Precise fixes only, no extra changes.
tools: Read, Write, Edit, Bash, Glob, Grep, mcp__exa__web_search_exa, mcp__exa__get_code_context_exa
model: sonnet
---
# Fixer Agent
You are the Fixer Agent in the Multi-Agent Pipeline.
## Context Auto-Injected
> **Important**: Hook has automatically injected the following into your context:
>
> - All dev specs and check specs (defined in fixer.jsonl)
> - codex-review-output.txt (Code Review results)
>
> You don't need to manually read these files, just refer to the injected context.
## Core Responsibilities
1. **Understand issues** - Analyze Code Review results in context
2. **Fix against specs** - Fix issues following injected dev specs
3. **Verify fixes** - Run typecheck to ensure no new issues
4. **Report results** - Report fix status to Router
---
## Workflow
### Step 1: Understand Issues
Code Review output is injected in context, parse the issue list:
- `[P1]` - Must fix
- `[P2]` - Should fix
- `[P3]` - Optional fix
### Step 2: Research if Needed
If you need additional info:
```bash
# Check experience/knowledge base
ls workflow/big-question/
```
If not found, use exa search:
- `mcp__exa__get_code_context_exa` - Code-related issues
- `mcp__exa__web_search_exa` - General technical issues
### Step 3: Fix One by One
For each issue:
1. Locate the exact position
2. Fix following specs in context
3. Run typecheck to verify
### Step 4: Verify
Reference `.husky/pre-commit` for verification:
```bash
cat .husky/pre-commit
```
If fix introduces new issues:
1. Revert the fix
2. Use a more complete solution
3. Re-verify
---
## Report Format
```markdown
## Fix Report
### Issues Fixed
1. ✅ `[P1]` `src/foo.ts:42` - Added error handling
2. ✅ `[P2]` `src/bar.ts:15` - Added explicit return type
### Issues Not Fixed
- ❌ `src/qux.ts:99` - Requires architectural change, suggest discussion
### Verification
- TypeCheck: ✅ Pass
- Lint: ✅ Pass
### Summary
Fixed 2/3 issues. 1 issue requires architectural discussion.
```
---
## Guidelines
### DO
- Precise fixes for reported issues
- Follow specs in context
- Verify each fix
### DON'T
- Don't refactor surrounding code
- Don't add new features
- Don't modify unrelated files
- Don't use `!` non-null assertion
- Don't execute git commit
---
name: router
description: |
Multi-Agent Pipeline main dispatcher. Pure dispatcher.
Does not write code directly, does not read spec/requirement files.
Only responsible for: calling subagents and scripts in phase order.
All context injection is handled by Hook, Router just issues call commands.
tools: Read, Bash, Task, mcp__exa__web_search_exa, mcp__exa__get_code_context_exa
model: sonnet
---
# Router Agent
You are the Router Agent in the Multi-Agent Pipeline (pure dispatcher).
## Working Directory Convention
Current Feature is specified by `workflow/.current-feature` file, content is the relative path to feature directory.
Feature directory path format: `workflow/agent-traces/{developer}/features/{day}-{category}/{name}/`
This directory contains all context files for the current task:
- `feature.json` - Task configuration
- `prd.md` - Requirements document
- `info.md` - Technical design (optional)
- `coder.jsonl` - Coder context
- `checker.jsonl` - Checker context
- `fixer.jsonl` - Fixer context
- `cr.jsonl` - Code Review context
## Core Principles
1. **You are a pure dispatcher** - Only responsible for calling subagents and scripts in order
2. **You don't read specs/requirements** - Hook will auto-inject all context to subagents
3. **You don't need resume** - Hook injects complete context on each subagent call
4. **You only need simple commands** - Tell subagent "start working" is enough
---
## Startup Flow
### Step 1: Determine Current Feature Directory
Read `workflow/.current-feature` to get current feature directory path:
```bash
FEATURE_DIR=$(cat workflow/.current-feature)
# e.g.: workflow/agent-traces/taosu/features/12-feature/my-feature
```
### Step 2: Read Feature Configuration
```bash
cat ${FEATURE_DIR}/feature.json
```
Get the `next_action` array, which defines the list of phases to execute.
### Step 3: Execute in Phase Order
Execute each step in `phase` order.
**Update `current_phase` field when starting a new phase**:
```bash
jq '.current_phase = {N}' ${FEATURE_DIR}/feature.json > ${FEATURE_DIR}/feature.json.tmp && mv ${FEATURE_DIR}/feature.json.tmp ${FEATURE_DIR}/feature.json
```
---
## Phase Handling (Minimal Version)
> Hook will auto-inject all specs, requirements, and technical design to subagent context.
> Router only needs to issue simple call commands.
### action: "read_specs" + "read_requirements" + "implement"
**Merged into one coder call**:
```
Task(
subagent_type: "coder",
prompt: "Implement the feature described in prd.md in the feature directory",
model: "opus",
run_in_background: true
)
```
Hook will auto-inject:
- All spec files (spec.jsonl)
- Requirements document (prd.md)
- Technical design (info.md)
- Check specs (check-*.md)
Coder receives complete context and autonomously: read → understand → implement.
### action: "self_check"
```
Task(
subagent_type: "checker",
prompt: "Check code changes, fix issues yourself",
model: "opus",
run_in_background: true
)
```
Hook will auto-inject:
- finish-work.md
- check-cross-layer.md
- check-backend.md
- check-frontend.md
- All spec files
### action: "code_review"
**Loop flow**: Review → Fix → Review
```
review_iteration = 0
max_iterations = 5
while review_iteration < max_iterations:
review_iteration += 1
// 1. Call review script (black box, don't need to know internals)
Bash("./workflow/scripts/codex-review.sh")
// 2. Read results
codex_output = Read("${FEATURE_DIR}/codex-review-output.txt")
// 3. Check if passed
if pass_condition_met:
break
// 4. Has issues, call Fixer
Task(
subagent_type: "fixer",
prompt: "Fix issues found in review",
model: "opus",
run_in_background: true
)
// Hook will auto-inject codex-review-output.txt and all specs
// Continue to next phase
```
**Pass conditions** (any one):
- Contains `✅`
- Contains `Code review passed` or `Review passed`
- Does not contain `[P1]`, `[P2]`, `[P3]`
### action: "finish_work"
```
Task(
subagent_type: "checker",
prompt: "Execute final completion check",
model: "opus",
run_in_background: true
)
```
Hook will auto-inject complete finish-work.md content.
### action: "create_pr"
```bash
./workflow/scripts/create-pr.sh
```
---
## Calling Subagents
### Basic Pattern
```
task_id = Task(
subagent_type: "coder", // or "checker", "fixer"
prompt: "Simple task description",
model: "opus",
run_in_background: true
)
// Poll for completion
for i in 1..N:
result = TaskOutput(task_id, block=true, timeout=300000)
if result.status == "completed":
break
```
### Timeout Settings
| Phase | Max Time | Poll Count |
|-------|----------|------------|
| coder (implement) | 30 min | 6 times |
| checker | 15 min | 3 times |
| fixer | 20 min | 4 times |
---
## Error Handling
### Timeout
```bash
./workflow/scripts/notify.sh \
--type blocked \
--feature "{feature_name}" \
--message "Subagent timeout: {phase}"
```
### Script Failure
```bash
./workflow/scripts/notify.sh \
--type blocked \
--feature "{feature_name}" \
--message "Script execution failed: {error_message}"
```
---
## Key Constraints
1. **Do not call codex command directly** - Only use review script
2. **Do not read spec/requirement files** - Let Hook inject to subagents
3. **Do not execute git/gh commands manually** - Only use PR script
4. **All subagents must use opus model**
---
name: searcher
description: |
Code and tech search expert. Pure research, no code modifications.
- Internal: Search project code, locate files, discover patterns
- External: Use exa to search tech solutions, best practices
Only document and explain, no suggestions (unless explicitly asked).
tools: Read, Glob, Grep, mcp__exa__web_search_exa, mcp__exa__get_code_context_exa
model: haiku
---
# Searcher Agent
You are the Searcher Agent in the Multi-Agent Pipeline.
## Core Principle
**You do one thing: find and explain information.**
You are a documenter, not a reviewer. Your job is to help Router and other agents get the information they need.
---
## Core Responsibilities
### 1. Internal Search (Project Code)
| Search Type | Goal | Tools |
|-------------|------|-------|
| **WHERE** | Locate files/components | Glob, Grep |
| **HOW** | Understand code logic | Read, Grep |
| **PATTERN** | Discover existing patterns | Grep, Read |
### 2. External Search (Tech Solutions)
| Search Type | Goal | Tools |
|-------------|------|-------|
| **Best Practices** | Tech solutions, design patterns | mcp__exa__web_search_exa |
| **Code Examples** | API usage, library docs | mcp__exa__get_code_context_exa |
---
## Strict Boundaries
### Only Allowed
- Describe **what exists**
- Describe **where it is**
- Describe **how it works**
- Describe **how components interact**
### Forbidden (unless explicitly asked)
- ❌ Suggest improvements
- ❌ Criticize implementation
- ❌ Recommend refactoring
- ❌ Modify any files
- ❌ Execute git commands
---
## Search Strategy
### 1. Breadth First, Then Depth
```
Round 1: Broad search, understand scope
Round 2: Focus on key areas
Round 3: Dive into details
```
### 2. Multi-Angle Search
- **Filename patterns**: `Glob("**/*.service.ts")`
- **Content keywords**: `Grep("pattern", "createEntity")`
- **Directory structure**: `Read` key index files
### 3. Cross-Validate
Confirm info from multiple sources, don't rely on single search result.
---
## Workflow
### Step 1: Understand Search Request
Analyze Router's query, determine:
- Search type (internal/external/mixed)
- Search scope (global/specific directory)
- Expected output (file list/code patterns/tech solutions)
### Step 2: Plan Search
```
Simple query (1-3 searches): Execute directly
Complex query (3+ directions): List search plan first, then execute
```
### Step 3: Execute Search
Execute multiple independent searches in parallel for efficiency.
### Step 4: Organize Results
Output structured results in report format.
---
## Report Formats
### Internal Search Report
```markdown
## Search Results
### Query
{original query}
### Files Found
| File Path | Description |
|-----------|-------------|
| `src/services/xxx.ts` | Main implementation |
| `src/types/xxx.ts` | Type definitions |
### Code Pattern Analysis
{Describe discovered patterns, cite specific files and line numbers}
### Related Spec Documents
- `workflow/structure/xxx.md` - {description}
### Not Found
{If some content was not found, explain}
```
### External Search Report
```markdown
## Tech Research Results
### Query
{original query}
### Key Findings
1. **{Finding 1}**
- Source: {URL}
- Key point: {brief}
2. **{Finding 2}**
- Source: {URL}
- Key point: {brief}
### Recommended References
- {URL1} - {description}
- {URL2} - {description}
### Notes
{If there are things to note}
```
### JSONL Recommendation Report (for Router to configure feature)
```markdown
## JSONL Configuration Recommendations
### Task Analysis
{Task brief}
### Recommended Spec Files
#### coder.jsonl
| File | Reason |
|------|--------|
| `workflow/structure/xxx.md` | xxx dev spec |
#### checker.jsonl
| File | Reason |
|------|--------|
| `workflow/structure/shared/quality.md` | Code quality check points |
#### fixer.jsonl
| File | Reason |
|------|--------|
| `workflow/structure/shared/quality.md` | Fix reference spec |
#### cr.jsonl
| File | Reason |
|------|--------|
| `workflow/big-question/` | Known issues and pitfalls |
```
---
## Common Search Patterns
### Find Spec Files
```bash
# Find all spec directories
Glob("workflow/structure/**/*.md")
# Find specific topic
Grep("database", "workflow/structure/")
```
### Find Code Patterns
```bash
# Find type definitions
Glob("**/types/*.ts")
Grep("export type|export interface", "src/")
# Find specific implementation
Grep("createEntity", "src/services/")
```
### Find Similar Implementations
```bash
# When implementing new feature, find similar existing implementations
Grep("similar_pattern", "src/")
Read("src/existing/similar.ts")
```
---
## Guidelines
### DO
- Provide specific file paths and line numbers
- Quote actual code snippets
- Distinguish "definitely found" and "possibly related"
- Explain search scope and limitations
### DON'T
- Don't guess uncertain info
- Don't omit important search results
- Don't add improvement suggestions in report (unless explicitly asked)
- Don't modify any files
# Agent Progress Index
> Records of all AI Agent work sessions across all developers
---
## Overview
This directory tracks progress for all developers working with AI Agents on this project.
### File Structure
```
agent-traces/
|-- index.md # This file - main index
\-- {developer}/ # Per-developer directory
|-- index.md # Personal index with session history
|-- features/ # Feature files
| |-- *.json # Active features
| \-- archive/ # Archived features by month
\-- progress-N.md # Progress files (sequential: 1, 2, 3...)
```
---
## Active Developers
| Developer | Last Active | Sessions | Active File |
|-----------|-------------|----------|-------------|
| (none yet) | - | - | - |
---
## Getting Started
### For New Developers
Run the initialization script:
```bash
./workflow/scripts/init-developer.sh <your-name>
```
This will:
1. Create your identity file (gitignored)
2. Create your progress directory
3. Create your personal index
4. Create initial progress file
### For Returning Developers
1. Get your developer name:
```bash
./workflow/scripts/get-developer.sh
```
2. Read your personal index:
```bash
cat workflow/agent-traces/$(./workflow/scripts/get-developer.sh)/index.md
```
---
## Guidelines
### Progress File Rules
- **Max 2000 lines** per progress file
- When limit is reached, create `progress-{N+1}.md`
- Update your personal `index.md` when creating new files
### Session Record Format
Each session should include:
- Summary: One-line description
- Main Changes: What was modified
- Git Commits: Commit hashes and messages
- Next Steps: What to do next
---
## Session Template
Use this template when recording sessions:
```markdown
## Session {N}: {Title}
**Date**: YYYY-MM-DD
**Feature**: {feature-name}
### Summary
{One-line summary}
### Main Changes
- {Change 1}
- {Change 2}
### Git Commits
| Hash | Message |
|------|---------|
| `abc1234` | {commit message} |
### Testing
- [OK] {Test result}
### Status
[OK] **Completed** / # **In Progress** / [P] **Blocked**
### Next Steps
- {Next step 1}
- {Next step 2}
```
---
**Language**: All documentation must be written in **English**.
# Development Workflow
> Based on [Effective Harnesses for Long-Running Agents](https://www.anthropic.com/engineering/effective-harnesses-for-long-running-agents)
---
## Table of Contents
1. [Workflow Overview](#workflow-overview)
2. [Session Start Process](#session-start-process)
3. [Development Process](#development-process)
4. [Session End](#session-end)
5. [File Descriptions](#file-descriptions)
6. [Best Practices](#best-practices)
---
## Workflow Overview
### Core Principles
1. **Read Before Write** - Understand context before starting
2. **Follow Standards** - [!] **MUST read `workflow/structure/` guidelines before coding**
3. **Incremental Development** - Complete one feature at a time
4. **Record Promptly** - Update tracking files immediately after completion
5. **Document Limits** - [!] **Max 2000 lines per agent-traces document**
### File System
```
workflow/
|-- .developer # Developer identity (gitignored)
|-- scripts/
| |-- common/ # Shared utilities
| | |-- paths.sh # Path utilities
| | |-- developer.sh # Developer management
| | \-- git-context.sh # Git context implementation
| |-- init-developer.sh # Initialize developer identity
| |-- get-developer.sh # Get current developer name
| |-- feature.sh # Manage features
| |-- get-context.sh # Get session context
| \-- add-session.sh # One-click session recording
|-- agent-traces/ # AI Agent work progress records
| |-- index.md # Progress index + Session template
| \-- {developer}/ # Per-developer directories
| |-- index.md # Personal index (with @@@auto markers)
| |-- features/ # Feature directories
| | \-- {day}-{name}/
| | \-- feature.json
| \-- progress-N.md # Progress files (sequential numbering)
|-- structure/ # [!] MUST READ before coding
| |-- frontend/ # Frontend guidelines (multi-doc)
| | |-- index.md # Start here - guidelines index
| | |-- directory-structure.md # Directory layout
| | |-- type-safety.md # TypeScript patterns
| | |-- hook-guidelines.md # React Query hooks
| | |-- component-guidelines.md # Component patterns
| | |-- state-management.md # State patterns
| | \-- quality-guidelines.md # Code standards
| |-- backend/ # Backend guidelines (multi-doc)
| | |-- index.md # Start here - guidelines index
| | |-- directory-structure.md # Directory layout
| | |-- type-safety.md # Zod, TypeScript patterns
| | |-- database-guidelines.md # ORM, batch operations
| | |-- logging-guidelines.md # Structured logging
| | |-- error-handling.md # Error types, handling
| | \-- quality-guidelines.md # Code standards
| \-- flows/ # Cross-layer specifications
| |-- index.md # Flow specs index
| |-- cross-layer-thinking-guide.md # Pre-implementation checklist
| \-- spec-flow-template.md # Template for new flows
\-- flow.md # This document
```
---
## Session Start Process
### Step 1: Get Session Context
Use the unified context script:
```bash
# Get all context in one command
./workflow/scripts/get-context.sh
# Or get JSON format
./workflow/scripts/get-context.sh --json
```
### Step 2: Read Development Guidelines [!] REQUIRED
**[!] CRITICAL: MUST read guidelines before writing any code**
Based on what you'll develop (frontend/backend), read the corresponding guidelines:
**Frontend Development**:
```bash
# 1. Read index first
cat workflow/structure/frontend/index.md
# 2. Read specific doc based on task
cat workflow/structure/frontend/hook-guidelines.md # For hooks
cat workflow/structure/frontend/component-guidelines.md # For components
cat workflow/structure/frontend/type-safety.md # For types
```
**Backend Development**:
```bash
# 1. Read index first
cat workflow/structure/backend/index.md
# 2. Read specific doc based on task
cat workflow/structure/backend/database-guidelines.md # For DB operations
cat workflow/structure/backend/type-safety.md # For Zod/types
cat workflow/structure/backend/logging-guidelines.md # For logging
```
**Cross-Layer Features**:
```bash
# For features spanning multiple layers
cat workflow/structure/flows/cross-layer-thinking-guide.md
```
### Step 3: Select Feature to Develop
Use the feature management script:
```bash
# List active features
./workflow/scripts/feature.sh list
# Create new feature (creates directory with feature.json)
./workflow/scripts/feature.sh create <feature-name>
```
---
## Development Process
### Feature Development Flow
```
1. Create or select feature
\-> ./workflow/scripts/feature.sh create <name> or list
2. Write code according to guidelines
\-> Read workflow/structure/[frontend|backend]/ docs
\-> For cross-layer: read workflow/structure/flows/
\-> Frontend: Type safety, Hook standards, Component standards
\-> Backend: Directory structure, Type safety, Database, Logging
3. Self-test
\-> pnpm lint (must pass)
\-> pnpm type-check (must pass)
\-> Manual feature testing
4. Commit code
\-> git add <files>
\-> git commit -m "type(scope): description"
Format: feat/fix/docs/refactor/test/chore
5. Record session (one command)
\-> ./workflow/scripts/add-session.sh --title "Title" --commit "hash"
```
### Code Quality Checklist
**Must pass before commit**:
- [OK] `pnpm lint` - 0 errors
- [OK] `pnpm type-check` - No type errors
- [OK] Manual feature testing passes
**Frontend-specific checks** (see `frontend/quality-guidelines.md`):
- [OK] Use semantic HTML (`<button>` not `<div role="button">`)
- [OK] Use Next.js `<Image>` instead of `<img>`
- [OK] Import types from backend, don't redefine
- [OK] Avoid non-null assertions `!`
**Backend-specific checks** (see `backend/quality-guidelines.md`):
- [OK] Strictly avoid non-null assertion `!`
- [OK] All API inputs/outputs have Zod Schema
- [OK] Use structured logging (`logger`), forbidden `console.log`
- [OK] Database operations avoid `await` in loops
---
## Session End
### One-Click Session Recording
After code is committed, use:
```bash
./workflow/scripts/add-session.sh \
--title "Session Title" \
--commit "abc1234" \
--summary "Brief summary"
```
This automatically:
1. Detects current progress file
2. Creates new file if 2000-line limit exceeded
3. Appends session content
4. Updates index.md (sessions count, history table)
### Pre-end Checklist
Use `/finish-work` command to run through:
1. [OK] All code committed, commit message follows convention
2. [OK] Session recorded via `add-session.sh`
3. [OK] No lint/type-check errors
4. [OK] Working directory clean (or WIP noted)
5. [OK] Structure docs updated if needed
---
## File Descriptions
### 1. agent-traces/ - Agent Work Progress
**Purpose**: Record each AI Agent session's work content
**Structure** (Multi-developer support):
```
agent-traces/
|-- index.md # Main index (Active Developers table)
\-- {developer}/ # Per-developer directory
|-- index.md # Personal index (with @@@auto markers)
|-- features/ # Feature directories
| \-- {day}-{name}/ # Each feature is a directory
| \-- feature.json
\-- progress-N.md # Progress files (sequential: 1, 2, 3...)
```
**When to update**:
- [OK] End of each session
- [OK] Complete important feature
- [OK] Fix important bug
### 2. structure/ - Development Guidelines
**Purpose**: Documented standards for consistent development
**Structure** (Multi-doc format):
```
structure/
|-- frontend/ # Frontend docs
| |-- index.md # Start here
| \-- *.md # Topic-specific docs
|-- backend/ # Backend docs
| |-- index.md # Start here
| \-- *.md # Topic-specific docs
\-- flows/ # Cross-layer specs
|-- index.md # Start here
\-- *.md # Flow-specific docs
```
**When to update**:
- [OK] New pattern discovered
- [OK] Bug fixed that reveals missing guidance
- [OK] New convention established
### 3. Features - Feature Tracking
Each feature is a directory containing `feature.json`:
```
features/
|-- 13-my-feature/
| \-- feature.json
\-- archive/
\-- 2025-01/
\-- 13-old-feature/
\-- feature.json
```
**Commands**:
```bash
./workflow/scripts/feature.sh create <name> # Create feature directory
./workflow/scripts/feature.sh archive <name> # Archive to archive/{year-month}/
./workflow/scripts/feature.sh list # List active features
./workflow/scripts/feature.sh list-archive # List archived features
```
---
## Best Practices
### [OK] DO - Should Do
1. **Before session start**:
- Run `./workflow/scripts/get-context.sh` for full context
- [!] **MUST read** relevant `workflow/structure/` docs
2. **During development**:
- [!] **Follow** `workflow/structure/` guidelines
- For cross-layer features, use `/check-cross-layer`
- Develop only one feature at a time
- Run lint and type-check frequently
3. **After development complete**:
- Use `/finish-work` for completion checklist
- After fix bug, use `/break-loop` for deep analysis
- Human commits after testing passes
- Use `add-session.sh` to record progress
### [X] DON'T - Should Not Do
1. [!] **Don't** skip reading `workflow/structure/` guidelines
2. [!] **Don't** let agent-traces single file exceed 2000 lines
3. **Don't** develop multiple unrelated features simultaneously
4. **Don't** commit code with lint/type-check errors
5. **Don't** forget to update structure docs after learning something
6. [!] **Don't** execute `git commit` - AI should not commit code
7. **Don't** write `workflow/structure/` docs in Chinese - **English only**
---
## Quick Reference
### Must-read Before Development
| Task Type | Must-read Document |
|-----------|-------------------|
| New Query Hook | `frontend/hook-guidelines.md` |
| New Component | `frontend/component-guidelines.md` |
| New Backend API | `backend/directory-structure.md`, `backend/type-safety.md` |
| Database Operations | `backend/database-guidelines.md` |
| Cross-Layer Feature | `flows/cross-layer-thinking-guide.md` |
### Commit Convention
```bash
git commit -m "type(scope): description"
```
**Type**: feat, fix, docs, refactor, test, chore
**Scope**: Module name (e.g., mail, auth, api)
### Common Commands
```bash
# Session management
./workflow/scripts/get-context.sh # Get full context
./workflow/scripts/add-session.sh # Record session
# Feature management
./workflow/scripts/feature.sh list # List features
./workflow/scripts/feature.sh create # Create feature
# Development
pnpm dev # Start dev server
pnpm lint # Lint check
pnpm type-check # Type check
# Slash commands
/finish-work # Pre-commit checklist
/break-loop # Post-debug analysis
/check-cross-layer # Cross-layer verification
```
---
## Summary
Following this workflow ensures:
- [OK] Continuity across multiple sessions
- [OK] Consistent code quality
- [OK] Trackable progress
- [OK] Knowledge accumulation in structure docs
- [OK] Transparent team collaboration
**Core Philosophy**: Read before write, follow standards, record promptly, capture learnings
# Code Reuse Thinking Guide
> **Purpose**: Stop and think before creating new code - does it already exist?
---
## The Problem
**Duplicated code is the #1 source of inconsistency bugs.**
When you copy-paste or rewrite existing logic:
- Bug fixes don't propagate
- Behavior diverges over time
- Codebase becomes harder to understand
---
## Before Writing New Code
### Step 1: Search First
```bash
# Search for similar function names
grep -r "functionName" .
# Search for similar logic
grep -r "keyword" .
```
### Step 2: Ask These Questions
| Question | If Yes... |
|----------|-----------|
| Does a similar function exist? | Use or extend it |
| Is this pattern used elsewhere? | Follow the existing pattern |
| Could this be a shared utility? | Create it in the right place |
| Am I copying code from another file? | **STOP** - extract to shared |
---
## Common Duplication Patterns
### Pattern 1: Copy-Paste Functions
**Bad**: Copying a validation function to another file
**Good**: Extract to shared utilities, import where needed
### Pattern 2: Similar Components
**Bad**: Creating a new component that's 80% similar to existing
**Good**: Extend existing component with props/variants
### Pattern 3: Repeated Constants
**Bad**: Defining the same constant in multiple files
**Good**: Single source of truth, import everywhere
---
## When to Abstract
**Abstract when**:
- Same code appears 3+ times
- Logic is complex enough to have bugs
- Multiple people might need this
**Don't abstract when**:
- Only used once
- Trivial one-liner
- Abstraction would be more complex than duplication
---
## After Batch Modifications
When you've made similar changes to multiple files:
1. **Review**: Did you catch all instances?
2. **Search**: Run grep to find any missed
3. **Consider**: Should this be abstracted?
---
## Checklist Before Commit
- [ ] Searched for existing similar code
- [ ] No copy-pasted logic that should be shared
- [ ] Constants defined in one place
- [ ] Similar patterns follow same structure
# Cross-Layer Thinking Guide
> **Purpose**: Think through data flow across layers before implementing.
---
## The Problem
**Most bugs happen at layer boundaries**, not within layers.
Common cross-layer bugs:
- API returns format A, frontend expects format B
- Database stores X, service transforms to Y, but loses data
- Multiple layers implement the same logic differently
---
## Before Implementing Cross-Layer Features
### Step 1: Map the Data Flow
Draw out how data moves:
```
Source → Transform → Store → Retrieve → Transform → Display
```
For each arrow, ask:
- What format is the data in?
- What could go wrong?
- Who is responsible for validation?
### Step 2: Identify Boundaries
| Boundary | Common Issues |
|----------|---------------|
| API ↔ Service | Type mismatches, missing fields |
| Service ↔ Database | Format conversions, null handling |
| Backend ↔ Frontend | Serialization, date formats |
| Component ↔ Component | Props shape changes |
### Step 3: Define Contracts
For each boundary:
- What is the exact input format?
- What is the exact output format?
- What errors can occur?
---
## Common Cross-Layer Mistakes
### Mistake 1: Implicit Format Assumptions
**Bad**: Assuming date format without checking
**Good**: Explicit format conversion at boundaries
### Mistake 2: Scattered Validation
**Bad**: Validating the same thing in multiple layers
**Good**: Validate once at the entry point
### Mistake 3: Leaky Abstractions
**Bad**: Component knows about database schema
**Good**: Each layer only knows its neighbors
---
## Checklist for Cross-Layer Features
Before implementation:
- [ ] Mapped the complete data flow
- [ ] Identified all layer boundaries
- [ ] Defined format at each boundary
- [ ] Decided where validation happens
After implementation:
- [ ] Tested with edge cases (null, empty, invalid)
- [ ] Verified error handling at each boundary
- [ ] Checked data survives round-trip
---
## When to Create Flow Documentation
Create detailed flow docs when:
- Feature spans 3+ layers
- Multiple teams are involved
- Data format is complex
- Feature has caused bugs before
# Thinking Guides
> **Purpose**: Expand your thinking to catch things you might not have considered.
---
## Why Thinking Guides?
**Most bugs and tech debt come from "didn't think of that"**, not from lack of skill:
- Didn't think about what happens at layer boundaries → cross-layer bugs
- Didn't think about code patterns repeating → duplicated code everywhere
- Didn't think about edge cases → runtime errors
- Didn't think about future maintainers → unreadable code
These guides help you **ask the right questions before coding**.
---
## Available Guides
| Guide | Purpose | When to Use |
|-------|---------|-------------|
| [Code Reuse Thinking Guide](./code-reuse-thinking-guide.md) | Identify patterns and reduce duplication | When you notice repeated patterns |
| [Cross-Layer Thinking Guide](./cross-layer-thinking-guide.md) | Think through data flow across layers | Features spanning multiple layers |
---
## Quick Reference: Thinking Triggers
### When to Think About Cross-Layer Issues
- [ ] Feature touches 3+ layers (API, Service, Component, Database)
- [ ] Data format changes between layers
- [ ] Multiple consumers need the same data
- [ ] You're not sure where to put some logic
→ Read [Cross-Layer Thinking Guide](./cross-layer-thinking-guide.md)
### When to Think About Code Reuse
- [ ] You're writing similar code to something that exists
- [ ] You see the same pattern repeated 3+ times
- [ ] You're adding a new field to multiple places
- [ ] **You're modifying any constant or config**
- [ ] **You're creating a new utility/helper function** ← Search first!
→ Read [Code Reuse Thinking Guide](./code-reuse-thinking-guide.md)
---
## Pre-Modification Rule (CRITICAL)
> **Before changing ANY value, ALWAYS search first!**
```bash
# Search for the value you're about to change
grep -r "value_to_change" .
```
This single habit prevents most "forgot to update X" bugs.
---
## How to Use This Directory
1. **Before coding**: Skim the relevant thinking guide
2. **During coding**: If something feels repetitive or complex, check the guides
3. **After bugs**: Add new insights to the relevant guide (learn from mistakes)
---
## Contributing
Found a new "didn't think of that" moment? Add it to the relevant guide.
---
**Core Principle**: 30 minutes of thinking saves 3 hours of debugging.