Skip to content

heymegabyte/agent-skills / 01-operating-system

operating-system

Verified

Supreme policy layer governing all agent behavior. Autonomy, one-line prompt interpretation, speed standards, emphasis signal processing, cross-skill coordination, done definitions, conflict resolution. Loaded every prompt.

FileKindSize
SKILL.mdskill md6.4 KB
ai-native-coding.mdmarkdown4.3 KB
architecture-thought-loop.mdmarkdown8.3 KB
autonomous-orchestrator.mdmarkdown9.2 KB
context-engineering.mdmarkdown3.2 KB
one-line-saas.mdmarkdown3.0 KB
output-compression.mdmarkdown3.5 KB

ai-native-coding.md

View on GitHub
---
name: "AI-Native Coding"
description: "Code patterns optimized for AI agents, not human habits. Explicit over implicit, flat over nested, self-documenting names, co-located context. AI should build complete full-stack systems with tight integration across all docs (CLAUDE.md, MEMORY.md, skills). Pushes beyond human coding patterns that limit AI capability."
version: "2.0.0"
updated: "2026-04-23"
---

# AI-Native Coding

## Principles

### 1. Explicit Over Implicit

```typescript
// BAD: const u = await db.get(id);
// GOOD: const user = await database.getUserById(userId);
```

- Everything needed to understand code is IN the code
- Not in heads, Slack, or meetings

### 2. Flat Over Nested

- Early returns, flat structure
- AI reads linearly
- `if (!user) return notFound();` not nested ifs

### 3. Co-Located Context

```typescript
// BAD: const LIMIT = 10;
// GOOD: /** Max form submissions per IP per 60s (CF KV rate limiter) */ const RATE_LIMIT_MAX_REQUESTS = 10;
```

### 4. Complete Over Incremental

- AI writes 500 lines in one pass
- Every function: all error cases, edge cases, types, validation, docs

### 5. Connected Over Isolated

- **CLAUDE.md** — describes system
- **README** — describes product
- **Code comments** — link related code
- **JSDoc `@see`** — link to API docs
- **Skills** — reference each other

## Full-Stack Integration (one pass per feature)

1. Schema (D1)
2. Validation (Zod shared)
3. API (Hono + JSDoc)
4. UI (component)
5. Test (E2E)
6. SEO (meta + structured data)
7. Analytics (PostHog event)
8. Docs (CLAUDE.md)
9. Deploy (wrangler)

## Documentation as Code

- **CLAUDE.md** — update on every architecture change. Remove stale refs on delete/move.
- **MEMORY.md** — preferences, patterns, corrections, project decisions.
- **Skills** — new capability → update skill. Deprecated → remove + note why.

## File Structure

- Source files: <300 lines (split at 200)
- Test files: <200 lines
- Names for scanability: `api-checkout.ts`, `stripe-service.ts`, `queries-users.ts`
- Imports order:
  1. External packages
  2. Internal modules
  3. Type-only imports

## AI Cost Management

| Use Case | API | Cost |
|----------|-----|------|
| Image gen | GPT Image 2 | ~$0.04 |
| Logo | Ideogram v3 | ~$0.03 |
| Video | Sora 2 | ~$0.10 |
| Alt text, translations, meta, keywords, a11y | Workers AI / Claude | $0 |

**Avoid:**

- AI background patterns (use CSS)
- AI icons (use Lucide)
- AI for simple text formatting

## Context Window Management

1. Use `_router.md` FIRST — load only needed skills
2. Reference `CONVENTIONS.md` (breakpoints, CSP, brand tokens, JSON-LD) — never duplicate
3. Prefer `file:line` pointers over pasting code blocks
4. Offload project decisions to `MEMORY.md`
5. **ToolSearch deferred tools** — bulk-load ALL at once (`query:"computer-use", max_results:30`); never one-by-one (each `select:` costs one full round-trip)

### Deduplication (canonical locations)

- Breakpoints, CSP, Hono starter, error envelope, Turnstile, deploy command, JSON-LD templates → `CONVENTIONS.md`
- Form test matrix, SEO audit, visual checklist → skill 07

## Research-Backed Patterns (2026)

- **AI-Native Development (InfoQ)** — Producer→Manager (review, don't write), Implementation→Intent (specs in markdown), Delivery→Discovery (multiple variants via worktrees), Content→Knowledge (knowledge bases from incidents)
- **CLAUDE.md Best Practices (HumanLayer)** — <200 lines (60 ideal). WHAT → WHY → HOW. Use `file:line` not snippets. Layer: global > team > personal.
- **Spec-Driven (Addy Osmani)** — Create `spec.md` before coding. Small single-purpose files. Commit after each task.
- **Code Comments for Agents** — Comment WHY not WHAT. Include gold standard reference. Show correct + incorrect examples.
- **Modern CSS (2026)** — `corner-shape: squircle`, Temporal API (replaces Moment.js), CSS scroll-driven animations (zero JS, 60fps)
- **llms.txt** — Add `/llms.txt` to every site with Quick Start + Architecture summary for AI discovery

## Ownership

- **Owns** — AI-native patterns, full-stack integration, docs-as-code, AI-optimized structure, creative AI cost management, context window strategy. See `STYLE_GUIDES.md` for Google TS + Node.js rules.
- **Never owns** — Implementation (→06), testing (→07), deployment (→08), design (→10), SEO (→28)
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 470kUpdated Claude CodeCodexVerifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 322kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 322kUpdated Claude CodeCodexVerifiedInstall
executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is availableStars: 322kUpdated Claude CodeCodexVerifiedInstall