agentleFS
vikibossvikiboss/60s/CLAUDE.md

60s

CLAUDE.md5.9k starsChanged 15 months agoMITView on GitHub

60s API is a comprehensive API collection providing news, trending topics, and utility services. Built with Deno and Oak framework, it supports multiple runtime environments (Deno, Node.js, Bun) and deployment platforms (Docker, Cloudflare Workers). Each API endpoint follows a consistent module pattern: Example structure: IMPORTANT: Unless specifically noted otherwise, ALL APIs MUST support these three encoding formats: Special formats (only when explicitly needed): - image - redirect to image URL - image-proxy - proxied image content - html - HTML…

We split this CLAUDE.md into the rules it gives an agent

6 rules. About 0 are common, 2 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Default timezone: Always use TZ_SHANGHAI (Asia/Shanghai) for all time operations unless explicitly specified otherwise.

    line 109
  2. Very specific:

    Type Safety: Use TypeScript types, avoid any when possible

    line 161
  3. Distinctive:

    Error Handling: Always handle fetch errors and invalid responses

    line 162
  4. Very specific:

    Consistency: Follow existing code patterns in src/modules/

    line 164
  5. Distinctive:

    Documentation: Add JSDoc comments for complex functions

    line 165
  6. Very specific:

    Testing: Test all three encoding formats (json/text/markdown) when adding new APIs

    line 166

≈ “Common” is an estimate: at least 1 in 5 of the 25,680 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Project Overview

60s API is a comprehensive API collection providing news, trending topics, and utility services. Built with Deno and Oak framework, it supports multiple runtime environments (Deno, Node.js, Bun) and deployment platforms (Docker, Cloudflare Workers).

Development Commands

Running the application

# Development mode (port 4398)
pnpm run dev

# Production mode (port 4398)
pnpm run start

# Docker
pnpm run docker:build
pnpm run docker:run

Common operations

# Update all lockfiles
pnpm run update-lockfile

# Release new version (bumps version and creates git tag)
pnpm run release

Architecture

Core Structure

  • Entry points: deno.ts, node.ts, bun.ts, cf-worker.ts for different runtimes
  • Main app: src/app.ts - Oak application with middleware setup
  • Routing: src/router.ts - centralized route definitions with /v2 prefix
  • Modules: src/modules/ - individual API service implementations
  • Middlewares: src/middlewares/ - cross-cutting concerns (CORS, error handling, encoding)

Key Components

  • Common utilities: src/common.ts - shared functions for JSON building, parameter extraction, date formatting
  • Configuration: src/config.ts - environment-based settings
  • Encoding middleware: Handles encoding query parameter for response format transformation

Development Guidelines

Module Development Pattern

Each API endpoint follows a consistent module pattern:

  1. Create service class in src/modules/[name].module.ts
  2. Implement handle() method returning Oak RouterMiddleware
  3. Handle different encoding formats in the middleware (see Response Formats below)
  4. Register route in src/router.ts
  5. Import and add to router configuration

Example structure:

export class MyModule {
  async handle(): RouterMiddleware<any> {
    return async (ctx) => {
      const encoding = ctx.state.encoding
      const data = await this.fetchData()

      if (encoding === 'text') {
        ctx.response.body = this.formatAsText(data)
      } else if (encoding === 'markdown') {
        ctx.response.body = this.formatAsMarkdown(data)
      } else {
        ctx.response.body = Common.buildJson(data)
      }
    }
  }
}

Response Format Standards

IMPORTANT: Unless specifically noted otherwise, ALL APIs MUST support these three encoding formats:

  • json (default) - structured JSON response via Common.buildJson()
  • text - plain text format for terminal/script usage
  • markdown - markdown formatted text for documentation/display

Special formats (only when explicitly needed):

  • image - redirect to image URL
  • image-proxy - proxied image content
  • html - HTML encoded output

Time Handling Standards

ALWAYS use dayjs for time operations:

import { dayjs, TZ_SHANGHAI } from './common.ts'

// Get current time in Shanghai timezone
const now = dayjs().tz(TZ_SHANGHAI)

// Format date
const dateStr = now.format('YYYY-MM-DD')

// Parse and convert timezone
const parsedDate = dayjs(timestamp).tz(TZ_SHANGHAI)

Default timezone: Always use TZ_SHANGHAI (Asia/Shanghai) for all time operations unless explicitly specified otherwise.

Common Patterns

Response Building:

// Success response
ctx.response.body = Common.buildJson(data)

// Error response with custom message
ctx.response.status = 400
ctx.response.body = Common.buildJson(null, 400, 'Custom error message')

// Require arguments
if (!param) {
  Common.requireArguments('paramName', ctx.response)
  return
}

Parameter Handling:

// Query parameters
const param = ctx.request.url.searchParams.get('param')

// Support both query and POST body (for large params)
const largeParam = await Common.getParam('param', ctx.request, true)

Web Scraping:

// Always use Common.chromeUA for User-Agent
const response = await fetch(url, {
  headers: { 'User-Agent': Common.chromeUA }
})

Caching:

// Implement caching for expensive operations
const cache = new Map<string, { data: any; timestamp: number }>()
const CACHE_TTL = 30 * 60 * 1000 // 30 minutes

// Check cache before fetching
const cached = cache.get(key)
if (cached && Date.now() - cached.timestamp < CACHE_TTL) {
  return cached.data
}

Code Quality Standards

  • Type Safety: Use TypeScript types, avoid any when possible
  • Error Handling: Always handle fetch errors and invalid responses
  • Validation: Validate required parameters using Common.requireArguments()
  • Consistency: Follow existing code patterns in src/modules/
  • Documentation: Add JSDoc comments for complex functions
  • Testing: Test all three encoding formats (json/text/markdown) when adding new APIs

Useful Utilities

From src/common.ts:

  • Common.buildJson() - Standard JSON response builder
  • Common.requireArguments() - Parameter validation
  • dayjs / TZ_SHANGHAI - Time operations (prefer over Common.localeDate()/Common.localeTime())
  • Common.randomInt() / Common.randomItem() - Random utilities
  • Common.md5() - MD5 hashing
  • Common.qs() - Query string builder
  • Common.tryRepoUrl() - GitHub CDN fallback fetcher

Note: Common.localeDate() and Common.localeTime() are legacy utilities. For new code, always use dayjs with TZ_SHANGHAI timezone as shown in the Time Handling Standards section.

Download now (ZIP)

Trending

Quiet since June.thin dataabout the whole repository

Dec 2025: 0 mentionsJan 2026: 0 mentionsFeb 2026: 0 mentionsMar 2026: 0 mentionsApr 2026: 1 mentionMay 2026: 0 mentionsJun 2026: 1 mentionJul 2026: 0 mentionsAug 2026: 0 mentionsSep 2026: 0 mentionsOct 2026: 0 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the vikiboss/60s repository that our weekly crawl found: only 3 in all, so this is a hint, not a trend. There is no adoption data for this file yet.

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

Reviews can't be read right now.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.