Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
eb2a72f
docs: add iCalendar feature documentation
eins78 Jul 19, 2025
34face4
feat: add event types for iCalendar generation
eins78 Jul 19, 2025
dc6ce49
feat: add ical-generator and rev-hash dependencies
eins78 Jul 19, 2025
6032d07
feat: implement iCalendar API endpoint
eins78 Jul 19, 2025
877470c
feat: add iCalendar demo page
eins78 Jul 19, 2025
b184c20
feat: add iCalendar demo link to homepage
eins78 Jul 19, 2025
0e5d35a
test: add E2E tests for iCalendar feature
eins78 Jul 19, 2025
2c2fa10
refactor: extract iCal helpers and add unit tests
eins78 Jul 19, 2025
c2ad675
docs: add project context documentation (CLAUDE.md)
eins78 Jul 19, 2025
58b25c1
fix: resolve formatting and linting issues
eins78 Jul 19, 2025
2a605e7
Merge main into feat/ical-demo
eins78 Jul 19, 2025
f2c23ab
fix: remove unused test file to resolve Knip linting
eins78 Jul 19, 2025
f7e79d5
docs: clarify git workflow - only squash CI fixes, preserve feature c…
eins78 Jul 19, 2025
a578627
Merge origin/main into feat/ical-demo
eins78 Jul 19, 2025
8c0366c
docs: enhance iCal documentation with vendor extensions and E2E test …
eins78 Jul 19, 2025
c4a3a9d
Merge branch 'main' into feat/ical-demo
eins78 Jul 20, 2025
2fc2af9
chore: add .claude/settings.local.json to .gitignore
eins78 Jul 20, 2025
7dd024b
feat: implement comprehensive E2E tests for iCalendar feature
eins78 Jul 20, 2025
d3fefde
chore: update timezone setting to Europe/Zurich in devcontainer confi…
eins78 Jul 20, 2025
8bccc93
chore: add fix script in package and silence subscripts
eins78 Jul 20, 2025
464b230
chore: install playwright browsers in devcontainer
eins78 Jul 20, 2025
4f04982
docs: improve CLAUDE.md with local-first CI workflow and fix ESLint e…
eins78 Jul 20, 2025
e6c3a2b
docs: add comprehensive timezone handling documentation
eins78 Jul 20, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,19 @@ RUN sh -c "$(wget -O- https://github.com/deluan/zsh-in-docker/releases/download/
RUN npm install -g \
corepack \
@antfu/ni \
playwright \
@anthropic-ai/claude-code

# Copy and set up firewall script
COPY init-firewall.sh /usr/local/bin/
# install playwright browsers
USER root
RUN chmod +x /usr/local/bin/init-firewall.sh && \
echo "node ALL=(root) NOPASSWD: /usr/local/bin/init-firewall.sh" > /etc/sudoers.d/node-firewall && \
chmod 0440 /etc/sudoers.d/node-firewall
RUN npm exec playwright install-deps
USER node
RUN npm exec playwright install

# Copy and set up init scripts
COPY node-init.sh init-firewall.sh install-playwright.sh /usr/local/bin/
USER root
RUN chmod +x /usr/local/bin/node-init.sh && \
echo "node ALL=(root) NOPASSWD: /usr/local/bin/node-init.sh" > /etc/sudoers.d/node-init && \
chmod 0440 /etc/sudoers.d/node-init
USER node
4 changes: 2 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"build": {
"dockerfile": "Dockerfile",
"args": {
"TZ": "${localEnv:TZ:America/Los_Angeles}"
"TZ": "${localEnv:TZ:Europe/Zurich}"
}
},
"runArgs": [
Expand Down Expand Up @@ -57,5 +57,5 @@
},
"workspaceMount": "source=${localWorkspaceFolder},target=/workspace,type=bind,consistency=delegated",
"workspaceFolder": "/workspace",
"postCreateCommand": "sudo /usr/local/bin/init-firewall.sh"
"postCreateCommand": "sudo /usr/local/bin/node-init.sh"
}
1 change: 1 addition & 0 deletions .devcontainer/init-firewall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ done < <(echo "$gh_ranges" | jq -r '(.web + .api + .git)[]' | aggregate -q)
# Resolve and add other allowed domains
for domain in \
"registry.npmjs.org" \
"chatgpt.com" \
"api.anthropic.com" \
"sentry.io" \
"statsig.anthropic.com" \
Expand Down
12 changes: 12 additions & 0 deletions .devcontainer/install-playwright.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash
set -uo pipefail

echo "Installing Playwright browsers"

npm i -g corepack && pnpm -v && \
cd /workspace/packages/ && \
pnpm install && \
cd /workspace/packages/e2e-tests/ && \
pnpm exec playwright install-deps && \
sudo -u node pnpm exec playwright install && \
echo "OK. Playwright browsers installed successfully."
5 changes: 5 additions & 0 deletions .devcontainer/node-init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

bash /usr/local/bin/install-playwright.sh

bash /usr/local/bin/init-firewall.sh
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,4 @@ typings/
/tmp/
/.pnpm-store/
.DS_Store
.claude/settings.local.json
252 changes: 252 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,252 @@
# AI Agent Guidelines

_Vendor-neutral instructions for AI coding assistants (GitHub Copilot, Claude, Cursor, etc.)_

## Key Rules

1. **Follow existing patterns** - Look at neighboring code before implementing
2. **Test everything** - Every feature needs unit tests AND E2E tests
3. **Document decisions** - Explain WHY, not just WHAT
4. **Keep it simple** - This is a demo project, avoid over-engineering
5. **Security first** - Even demos should follow security best practices

## Coding Standards

### TypeScript Style

- Use 2-space indentation for all files
- Use explicit return types for functions
- Use type imports with the `type` keyword
- Use `type` for object shapes and primitives
- NEVER use enums - use simple string unions instead
- Prefer const assertions for literal types
- Prefer `type` over `interface` for object types

### Naming Conventions

- **Variables, parameters, functions**: camelCase
- **Classes, interfaces, types**: PascalCase
- **Constants**: UPPER_CASE
- **Files**: kebab-case for utilities, PascalCase for components/types
- **Folders**: kebab-case

### File Organization

- One export per file when possible
- Group related functionality in directories
- Use index.ts files to re-export from directories
- Keep files focused and under 300 lines when possible
- Routes go in `/src/routes/` with subdirectories for organization
- Types go in `/src/types/` as separate files
- Unit tests are colocated as `*.test.ts` files
- E2E tests go in `/packages/e2e-tests/`
- Feature docs go in `/docs/features/`

## Commit Messages

```
feat: add calendar subscription endpoint

Implements RFC 5545 compliant iCalendar feed to test
client compatibility across different calendar apps.

Fixes #123
```

- First line: `<type>: <description>` (lowercase, ≤72 chars)
- Types: `feat`, `fix`, `docs`, `test`, `refactor`, `chore`
- Body: Explain WHY the change was made
- Reference issues with `Fixes #123` or `Relates to #123`
- Create feature branches as `feat/feature-name`
- If GPG issues: `git commit --no-gpg-sign -m "message"`

## Documentation Standards

1. Every module should include JSDoc comments for all exported functions, classes, and interfaces
2. Include parameter descriptions, return type descriptions, and examples
3. Document thrown exceptions
4. Update relevant documentation when changing functionality

## Testing Guidelines

### Unit Tests

- Test files should be colocated with source files as `*.test.ts`
- ALWAYS use Node.js built-in test runner (not Jest, Vitest, etc.)
- Focus on testing business logic and edge cases
- Use descriptive test names that explain the expected behavior

### E2E Tests

- Located in `/packages/e2e-tests/`
- Use Cypress for browser automation (or Playwright for BDD approach)
- Test user flows and integration between components
- Include visual regression tests where appropriate

#### E2E Framework Migration Guidelines

When migrating between test frameworks:
1. **Check Node.js version requirements** - Some features require specific versions
2. **Verify package versions exist** before adding to package.json
3. **Read all files before editing** - Even if you know the content
4. **Update CI/CD workflows** - Located in `.github/workflows/`
5. **Test locally first** when possible

#### BDD Testing Pattern

If using Playwright with BDD:
- Write features in Gherkin syntax in `/features/` directory
- Implement step definitions in `/steps/` directory
- Use Page Object Model in `/pages/` directory
- Use `createBdd()` pattern for importing Given/When/Then
- Generate test files with `pnpm run generate` before running tests

## Error Handling

1. Use descriptive error messages
2. Include context in error messages
3. Prefer explicit error handling over try-catch for expected errors
4. Log errors appropriately without exposing sensitive information

## Code Review Checklist

When reviewing or writing code, ensure:

- [ ] Code follows the established patterns in the codebase
- [ ] New features include appropriate tests
- [ ] Documentation is updated where necessary
- [ ] No console.log statements in production code
- [ ] Error cases are handled appropriately
- [ ] Security considerations have been addressed

## Dependencies

**ALWAYS prefer built-in Node.js modules over external packages**

When adding dependencies:
1. Justify why it's needed in the PR
2. Pin exact version (no ^ or ~)
3. Check bundle size impact
4. Verify license compatibility

Example justification:
```
Adding ical-generator@9.0.0:
- Needed for RFC 5545 compliant calendar generation
- No suitable Node.js built-in alternative
- MIT licensed, 45KB minified
```

## Demo Development Process

### When Adding New Demo Features
1. ALWAYS create feature documentation first in `/docs/features/`
2. ALWAYS implement types before implementation in `/src/types/`
3. ALWAYS add both unit tests and E2E tests
4. ALWAYS link new demos from the homepage
5. ALWAYS test with multiple browsers/clients
6. ALWAYS document vendor-specific workarounds

### Demo Requirements Checklist
- [ ] Single concept focus (one demo = one feature)
- [ ] Live interactive demo at `/demos/<feature>`
- [ ] API endpoint documented with curl examples
- [ ] Client compatibility table in docs
- [ ] Links to official specs (RFC, W3C, etc.)
- [ ] E2E tests covering happy path + edge cases
- [ ] Vendor workarounds documented with examples

## Security Considerations

- Never expose sensitive information in demos
- Use placeholder data for examples
- Validate all user inputs
- Follow OWASP guidelines for web security
- Document any intentional security simplifications for demo purposes

## Workflow Efficiency Guidelines

### Before Starting Major Changes
1. **Check environment compatibility** (Node.js version, etc.)
2. **Verify all dependencies exist** with correct versions
3. **Locate configuration files** using absolute paths
4. **Read files before editing** - always use Read tool first

### Common File Locations
- CI/CD workflows: `/workspace/.github/workflows/`
- E2E tests: `/workspace/packages/e2e-tests/`
- Documentation: `/workspace/docs/`
- Types: `/workspace/packages/app/src/types/`

### Tool Usage Best Practices
1. **Batch related operations** - Use multiple tool calls in parallel when possible
2. **Use Glob for finding files** - More efficient than multiple LS commands
3. **Check command output** - Don't assume operations succeeded
4. **Handle errors gracefully** - Have fallback plans for common issues

### File System Operations

#### Efficient Patterns
1. **Bulk File Discovery**
```bash
# Good - Single glob for multiple patterns
Glob("**/*.{test,spec}.{js,ts}")

# Avoid - Multiple sequential globs
Glob("**/*.test.js")
Glob("**/*.test.ts")
```

2. **Smart File Reading**
- Read configuration files early to understand project structure
- Use `head_limit` parameter in `Grep` for large codebases
- Read multiple related files in parallel when analyzing code patterns

3. **Batch Editing**
- Group related changes together
- Use `replace_all` parameter when renaming variables/functions
- Plan multi-file refactoring before starting

### Test Framework Migration Pattern

1. **Initial Assessment Phase**
- Use `Glob` to find all test files at once
- Read package.json files to understand current dependencies
- Check CI workflows early to understand test execution context

2. **Common Mistakes to Avoid**
- Creating files one by one instead of batch operations
- Incomplete initial implementation requiring multiple edits
- Missing configuration updates (tsconfig.json, CI workflows)
- Installing dependencies one by one instead of batch updates

3. **Systematic Approach**
- Map old test structure to new framework
- Create all page objects first before migrating tests
- Update all related configuration files together
- Test locally before pushing changes

### Monorepo-Specific Patterns

1. **Workspace Management**
- Check workspace configuration files first (pnpm-workspace.yaml, etc.)
- Understand package interdependencies
- Use workspace-aware commands (`pnpm -w`, `pnpm -F <package>`)

2. **Dependency Installation**
- Use correct package manager workspace commands
- Install at appropriate level (workspace root vs package)
- Verify lockfile updates after changes

### CI/CD Best Practices

1. **Proactive Checks**
- Always check existing CI workflows before making changes
- Verify workspace configurations (monorepo setup, package managers)
- Test locally mimicking CI environment when possible

2. **Common CI Issues**
- Missing working directory specifications
- Incorrect dependency installation commands for monorepos
- Browser installation requirements for E2E tests
- Node.js version mismatches
Loading