Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
98bf0df
feat: decode zstd request bodies
Jul 1, 2026
aa113c2
chore: add Trellis workflow and CPA migration record
Jul 1, 2026
e7546ff
chore(task): archive 07-01-sjc-sub2api-cpa-production-migration
Jul 1, 2026
130b5f0
chore: record journal
Jul 1, 2026
e9c2dee
docs: record CPA CodexCont rollout
Jul 1, 2026
a08fce1
docs: record CPA admin tunnel validation
Jul 1, 2026
a3d2177
chore(task): archive 07-01-cpa-codexcont-sidecar-admin-tunnel
Jul 1, 2026
82e54b8
feat: add CodexCont status dashboard
Jul 1, 2026
5b578e1
feat: add Chinese protection dashboard
Jul 1, 2026
42c1b14
docs: capture CodexCont dashboard contracts
Jul 1, 2026
22004b5
chore(task): archive 07-01-codexcont-status-dashboard
Jul 1, 2026
fede256
chore: record journal
Jul 1, 2026
1c4feec
fix: clarify dashboard truncation trigger
Jul 1, 2026
b20a983
feat: add CPA usage portal
Jul 1, 2026
61911b0
docs: capture CPA key management closeout
Jul 1, 2026
a92963f
chore(task): archive 07-01-cpa-key-management-portal
Jul 1, 2026
254bf50
chore: record journal
Jul 1, 2026
5737e3b
feat: refresh custom CPA dashboards
Jul 1, 2026
c2a18f2
feat: improve dashboard pricing and live refresh
Jul 1, 2026
48c03f9
fix: align usage range selector with events
Jul 1, 2026
762b9e6
feat: add CPA usage quota admin
Jul 1, 2026
3f960f5
chore(task): archive 07-01-dashboard-visual-refresh
Jul 1, 2026
4b6186a
chore: record journal
Jul 1, 2026
432ca38
feat: improve CPA usage request details
Jul 1, 2026
9880b45
chore(task): archive 07-02-usage-admin-batch-save-request-details
Jul 1, 2026
fd5a347
chore: record journal
Jul 1, 2026
429bed5
feat: add CPA Governor plugin and engine rollout
Jul 1, 2026
d9047c8
fix: clarify Governor user key login
Jul 2, 2026
50e77d0
fix: harden Governor user login in CPAMP
Jul 2, 2026
69e429e
docs: record Governor login closeout
Jul 2, 2026
5eb4653
chore(task): archive 07-02-cpa-governor-codexcont-engine
Jul 2, 2026
8a54fba
chore: record journal
Jul 2, 2026
9d04f7b
feat: refresh Governor realtime UI
Jul 2, 2026
5820680
chore(task): archive 07-02-governor-ui-route-cleanup
Jul 2, 2026
322b8a8
feat: align governor dashboards with CPAMP style
Jul 2, 2026
bb51a9d
chore(task): archive 07-02-governor-cpamp-style-alignment
Jul 2, 2026
160af51
feat: add CPA Key Policy Plus plugin
Jul 2, 2026
3ebd910
chore(task): archive 07-02-cpa-key-policy-plus-unified-control
Jul 2, 2026
d206871
chore: record journal
Jul 2, 2026
4c6613b
fix: repair CPA Key Policy Plus admin flows
Jul 2, 2026
ce12c1f
chore(task): archive 07-02-cpa-key-policy-plus-admin-fixes
Jul 2, 2026
e2082a2
chore: record journal
Jul 2, 2026
57aadff
fix: stabilize CPA Key Policy Plus UX
Jul 2, 2026
3fc7877
chore(task): archive 07-02-cpa-usage-key-policy-plus-ux-fixes
Jul 2, 2026
6a85143
chore: record journal
Jul 2, 2026
793b4ae
fix: tolerate stale Key Policy Plus session cookies
Jul 2, 2026
a5ddecb
docs: capture Key Policy Plus session cookie contract
Jul 2, 2026
5395b0d
chore: record journal
Jul 2, 2026
30fa42b
fix: retire key policy session limits
Jul 2, 2026
b6e6aa3
chore(task): archive 07-02-key-policy-plus-rpm-delete-ui-unify
Jul 2, 2026
54f08aa
chore: record journal
Jul 2, 2026
32b8ff1
fix: simplify CPA usage range UX
Jul 3, 2026
139d53c
feat: add CodexCont executor plugin
Jul 3, 2026
7488a65
feat: migrate CodexCont executor plugin
Jul 3, 2026
b46c4d5
feat: migrate key policy plus to native keys
Jul 3, 2026
a951bc9
chore(task): archive 07-03-cpa-key-policy-native-keys
Jul 3, 2026
6fb62f8
chore: record journal
Jul 3, 2026
7d4a1b0
chore(task): archive 07-03-cpa-usage-range-ux
Jul 3, 2026
8b35d72
chore(task): archive 07-03-codexcont-executor-plugin
Jul 3, 2026
837b48a
fix(cpa): sync native keys and restore Codex model routing
Jul 3, 2026
fe70d00
chore(task): archive 07-03-07-03-native-key-sync-auth-availability
Jul 3, 2026
e062d7b
chore: record journal
Jul 3, 2026
c799e47
fix(cpa): harden key policy native mirror
Jul 3, 2026
183691f
chore(task): archive 07-04-cpa-key-policy-plus-sqlite-native-chain
Jul 3, 2026
20ce91e
chore: record journal
Jul 3, 2026
737befe
fix(cpa): handle executor tools and native aliases
Jul 3, 2026
149f580
chore(task): archive 07-04-executor-tool-routing-native-aliases
Jul 3, 2026
38d5336
chore: record journal
Jul 3, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
40 changes: 40 additions & 0 deletions .agents/skills/trellis-before-dev/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
name: trellis-before-dev
description: "Discovers and injects project-specific coding guidelines from .trellis/spec/ before implementation begins. Reads spec indexes, pre-development checklists, and shared thinking guides for the target package. Use when starting a new coding task, before writing any code, switching to a different package, or needing to refresh project conventions and standards."
---

Read the relevant development guidelines before starting your task.

Execute these steps:

1. **Read current task artifacts**:
- `prd.md` for requirements and acceptance criteria
- `design.md` if present for technical design
- `implement.md` if present for execution order and validation plan

2. **Discover packages and their spec layers**:
```bash
python ./.trellis/scripts/get_context.py --mode packages
```

3. **Identify which specs apply** to your task based on:
- Which package you're modifying (e.g., `cli/`, `docs-site/`)
- What type of work (backend, frontend, unit-test, docs, etc.)
- Any spec/research paths referenced by the task artifacts

4. **Read the spec index** for each relevant module:
```bash
cat .trellis/spec/<package>/<layer>/index.md
```
Follow the **"Pre-Development Checklist"** section in the index.

5. **Read the specific guideline files** listed in the Pre-Development Checklist that are relevant to your task. The index is NOT the goal — it points you to the actual guideline files (e.g., `error-handling.md`, `conventions.md`, `mock-strategies.md`). Read those files to understand the coding standards and patterns.

6. **Always read shared guides**:
```bash
cat .trellis/spec/guides/index.md
```

7. Understand the coding standards and patterns you need to follow, then proceed with your development plan.

This step is **mandatory** before writing any code.
112 changes: 112 additions & 0 deletions .agents/skills/trellis-brainstorm/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
---
name: trellis-brainstorm
description: "Guides collaborative requirements discovery before implementation. Creates task directory, seeds PRD, asks high-value questions one at a time, researches technical choices, and converges on MVP scope. Use when requirements are unclear, there are multiple valid approaches, or the user describes a new feature or complex task."
---

# Trellis Brainstorm

## Non-Negotiable Interview Contract

Interview me relentlessly about every aspect of this plan until we reach a shared understanding. Walk down each branch of the design tree, resolving dependencies between decisions one-by-one. For each question, provide your recommended answer.

Ask the questions one at a time.

## Non-Negotiable Evidence Rule

If a question can be answered by exploring the codebase, explore the codebase instead.

This is mandatory. Before asking the user a question, first check whether the answer is already available in code, tests, configs, docs, existing specs, or task history.

Do not ask the user to confirm facts that the repository can answer. Ask only for product intent, preference, scope, risk tolerance, or decisions that remain ambiguous after inspection.

---

Use this skill during Phase 1 planning to turn the user's request into clear requirements and planning artifacts.

## Preconditions

Use this skill only after task-creation consent has been given and the user is ready to enter Trellis planning.

If no task exists yet, create one:

```bash
TASK_DIR=$(python ./.trellis/scripts/task.py create "<short task title>" --slug <slug>)
```

Use a concise title from the user's request. Use a slug without a date prefix. `task.py create` adds the `MM-DD-` directory prefix automatically.

`task.py create` creates the default `prd.md`. Update that file with the current understanding before asking follow-up questions.

## Planning Flow

1. Capture the user's request and initial known facts in `prd.md`.
2. Inspect available evidence before asking questions:
- code, tests, fixtures, and configs
- README files, docs, existing specs, and domain notes
- related Trellis tasks, research files, and session history when present
3. Separate what you found into:
- confirmed facts
- product intent still needed from the user
- scope or risk decisions still needed from the user
- likely out-of-scope items
4. Ask the single highest-value remaining question.
5. Include your recommended answer with the question.
6. After each user answer, update `prd.md` before continuing.
7. For complex tasks, create or update `design.md` and `implement.md` before implementation starts.

Do not invent a project-specific product/spec hierarchy. If the repository already has product, domain, or spec docs, use them. If it does not, proceed with the evidence that exists.

## Question Rules

Ask only one question per message.

Each question must include:

- the decision needed
- why the answer matters
- your recommended answer
- the trade-off if the user chooses differently

Do not ask process questions such as whether to search, inspect files, or continue brainstorming. Do the evidence work directly. Ask the user only when the remaining issue is a product decision, preference, scope boundary, or risk tolerance choice.

## Artifact Rules

`prd.md` records requirements and acceptance:

- goal and user value
- confirmed facts
- requirements
- acceptance criteria
- out of scope
- open questions that still block planning

`design.md` records technical design for complex tasks:

- architecture and boundaries
- data flow and contracts
- compatibility and migration notes
- important trade-offs
- operational or rollback considerations

`implement.md` records execution planning for complex tasks:

- ordered implementation checklist
- validation commands
- risky files or rollback points
- follow-up checks before `task.py start`

Lightweight tasks may have only `prd.md`. Complex tasks must have `prd.md`, `design.md`, and `implement.md` before `task.py start`.

`implement.md` is not a replacement for `implement.jsonl`. Use JSONL files only for manifest-style spec and research references when the task needs them.

## Quality Bar

Before declaring planning ready:

- `prd.md` contains testable acceptance criteria.
- Repository-answerable questions have already been answered through inspection.
- Remaining open questions are genuinely about user intent or scope.
- Complex tasks have `design.md` and `implement.md`.
- The user has reviewed the final planning artifacts or explicitly approved proceeding.

Do not start implementation until the user approves or asks for implementation.
130 changes: 130 additions & 0 deletions .agents/skills/trellis-break-loop/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
---
name: trellis-break-loop
description: "Deep bug analysis to break the fix-forget-repeat cycle. Analyzes root cause category, why fixes failed, prevention mechanisms, and captures knowledge into specs. Use after fixing a bug to prevent the same class of bugs."
---

# Break the Loop - Deep Bug Analysis

When debug is complete, use this for deep analysis to break the "fix bug -> forget -> repeat" cycle.

---

## Analysis Framework

Analyze the bug you just fixed from these 5 dimensions:

### 1. Root Cause Category

Which category does this bug belong to?

| Category | Characteristics | Example |
|----------|-----------------|---------|
| **A. Missing Spec** | No documentation on how to do it | New feature without checklist |
| **B. Cross-Layer Contract** | Interface between layers unclear | API returns different format than expected |
| **C. Change Propagation Failure** | Changed one place, missed others | Changed function signature, missed call sites |
| **D. Test Coverage Gap** | Unit test passes, integration fails | Works alone, breaks when combined |
| **E. Implicit Assumption** | Code relies on undocumented assumption | Timestamp seconds vs milliseconds |

### 2. Why Fixes Failed (if applicable)

If you tried multiple fixes before succeeding, analyze each failure:

- **Surface Fix**: Fixed symptom, not root cause
- **Incomplete Scope**: Found root cause, didn't cover all cases
- **Tool Limitation**: grep missed it, type check wasn't strict
- **Mental Model**: Kept looking in same layer, didn't think cross-layer

### 3. Prevention Mechanisms

What mechanisms would prevent this from happening again?

| Type | Description | Example |
|------|-------------|---------|
| **Documentation** | Write it down so people know | Update thinking guide |
| **Architecture** | Make the error impossible structurally | Type-safe wrappers |
| **Compile-time** | Strict type checking, no escape hatches | Signature change causes compile error |
| **Runtime** | Monitoring, alerts, scans | Detect orphan entities |
| **Test Coverage** | E2E tests, integration tests | Verify full flow |
| **Code Review** | Checklist, PR template | "Did you check X?" |

### 4. Systematic Expansion

What broader problems does this bug reveal?

- **Similar Issues**: Where else might this problem exist?
- **Design Flaw**: Is there a fundamental architecture issue?
- **Process Flaw**: Is there a development process improvement?
- **Knowledge Gap**: Is the team missing some understanding?

### 5. Knowledge Capture

Solidify insights into the system:

- [ ] Update `.trellis/spec/guides/` thinking guides
- [ ] Update relevant `.trellis/spec/` docs
- [ ] Create issue record (if applicable)
- [ ] Create feature ticket for root fix
- [ ] Update check guidelines if needed

---

## Output Format

Please output analysis in this format:

```markdown
## Bug Analysis: [Short Description]

### 1. Root Cause Category
- **Category**: [A/B/C/D/E] - [Category Name]
- **Specific Cause**: [Detailed description]

### 2. Why Fixes Failed (if applicable)
1. [First attempt]: [Why it failed]
2. [Second attempt]: [Why it failed]
...

### 3. Prevention Mechanisms
| Priority | Mechanism | Specific Action | Status |
|----------|-----------|-----------------|--------|
| P0 | ... | ... | TODO/DONE |

### 4. Systematic Expansion
- **Similar Issues**: [List places with similar problems]
- **Design Improvement**: [Architecture-level suggestions]
- **Process Improvement**: [Development process suggestions]

### 5. Knowledge Capture
- [ ] [Documents to update / tickets to create]
```

---

## Core Philosophy

> **The value of debugging is not in fixing the bug, but in making this class of bugs never happen again.**

Three levels of insight:
1. **Tactical**: How to fix THIS bug
2. **Strategic**: How to prevent THIS CLASS of bugs
3. **Philosophical**: How to expand thinking patterns

30 minutes of analysis saves 30 hours of future debugging.

---

## After Analysis: Immediate Actions

**IMPORTANT**: After completing the analysis above, you MUST immediately:

1. **Update spec/guides** - Don't just list TODOs, actually update the relevant files:
- If it's a cross-platform issue → update `cross-platform-thinking-guide.md`
- If it's a cross-layer issue → update `cross-layer-thinking-guide.md`
- If it's a code reuse issue → update `code-reuse-thinking-guide.md`
- If it's domain-specific → update `backend/*.md` or `frontend/*.md`

2. **Sync templates** - After updating `.trellis/spec/`, sync to `src/templates/markdown/spec/`

3. **Commit the spec updates** - This is the primary output, not just the analysis text

> **The analysis is worthless if it stays in chat. The value is in the updated specs.**
98 changes: 98 additions & 0 deletions .agents/skills/trellis-check/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
---
name: trellis-check
description: "Comprehensive quality verification: spec compliance, lint, type-check, tests, cross-layer data flow, code reuse, and consistency checks. Use when code is written and needs quality verification, before committing changes, or to catch context drift during long sessions."
---

# Code Quality Check

Comprehensive quality verification for recently written code. Combines spec compliance, cross-layer safety, and pre-commit checks.

---

## Step 1: Identify What Changed

```bash
git diff --name-only HEAD
git status
```

## Step 2: Read Task Artifacts and Applicable Specs

Read the current task artifacts in order:

- `prd.md`
- `design.md` if present
- `implement.md` if present

```bash
python ./.trellis/scripts/get_context.py --mode packages
```

For each changed package/layer, read the spec index and follow its **Quality Check** section:

```bash
cat .trellis/spec/<package>/<layer>/index.md
```

Read the specific guideline files referenced — the index is a pointer, not the goal.

## Step 3: Run Project Checks

Run the project's lint, type-check, and test commands. Fix any failures before proceeding.

## Step 4: Review Against Checklist

### Code Quality

- [ ] Linter passes?
- [ ] Type checker passes (if applicable)?
- [ ] Tests pass?
- [ ] No debug logging left in?
- [ ] No suppressed warnings or type-safety bypasses?

### Test Coverage

- [ ] New function → unit test added?
- [ ] Bug fix → regression test added?
- [ ] Changed behavior → existing tests updated?

### Spec Sync

- [ ] Does `.trellis/spec/` need updates? (new patterns, conventions, lessons learned)

> "If I fixed a bug or discovered something non-obvious, should I document it so future me won't hit the same issue?" → If YES, update the relevant spec doc.

## Step 5: Cross-Layer Dimensions (if applicable)

Skip this step if your change is confined to a single layer.

### A. Data Flow (changes touch 3+ layers)

- [ ] Read flow traces correctly: Storage → Service → API → UI
- [ ] Write flow traces correctly: UI → API → Service → Storage
- [ ] Types/schemas correctly passed between layers?
- [ ] Errors properly propagated to caller?

### B. Code Reuse (modifying constants, creating utilities)

- [ ] Searched for existing similar code before creating new?
```bash
grep -r "pattern" src/
```
- [ ] If 2+ places define same value → extracted to shared constant?
- [ ] After batch modification, all occurrences updated?

### C. Import/Dependency (creating new files)

- [ ] Correct import paths (relative vs absolute)?
- [ ] No circular dependencies?

### D. Same-Layer Consistency

- [ ] Other places using the same concept are consistent?

---

## Step 6: Report and Fix

Report violations found and fix them directly. Re-run project checks after fixes.
Loading