@simpleapps-com/augur-skills 0.0.17 → 0.0.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@simpleapps-com/augur-skills",
3
- "version": "0.0.17",
3
+ "version": "0.0.20",
4
4
  "description": "Install curated Claude Code skills",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -0,0 +1,163 @@
1
+ ---
2
+ name: augur-packages
3
+ description: Shared npm packages under @simpleapps-com/augur-*. Covers what each package provides, correct import patterns, key usage patterns, and what custom code they replace. Use when writing code for a site that consumes augur packages, during migration, or when deciding whether to write custom code.
4
+ ---
5
+
6
+ # Augur Packages
7
+
8
+ Shared npm packages for Next.js ecommerce sites and React Native apps. Published to npm under `@simpleapps-com`. Source: `simpleapps-com/augur-packages`.
9
+
10
+ Before writing custom code, check whether a package export already solves the problem.
11
+
12
+ ## augur-utils
13
+
14
+ Types, formatters, cache config. Zero framework dependencies. Works everywhere.
15
+
16
+ ```typescript
17
+ import { formatPrice, CACHE_CONFIG } from "@simpleapps-com/augur-utils";
18
+ import type { TCartLine, TProductItem } from "@simpleapps-com/augur-utils";
19
+ import { cn } from "@simpleapps-com/augur-utils/web"; // clsx + tailwind-merge
20
+ ```
21
+
22
+ **Types** cover: cart, category, inventory, product, pricing, attributes, UOM, supplier, filter, customer, menu, order, shipping, search, tax, metadata. Each has a Valibot schema (e.g., `CartLineSchema`).
23
+
24
+ **Cache tiers** for React Query — every hook maps to one of these:
25
+
26
+ | Tier | Use Case |
27
+ |------|----------|
28
+ | `CACHE_CONFIG.STATIC` | Rarely changes (categories, item master) |
29
+ | `CACHE_CONFIG.SEMI_STATIC` | Changes occasionally (pricing, search) |
30
+ | `CACHE_CONFIG.DYNAMIC` | Changes frequently (stock levels) |
31
+ | `CACHE_CONFIG.CART` | User-specific, short-lived |
32
+ | `CACHE_CONFIG.REALTIME` | Always refetch |
33
+
34
+ ## augur-web
35
+
36
+ shadcn/Radix UI components. Per-component entry points — no barrel export, only what you import gets bundled.
37
+
38
+ ```typescript
39
+ import { Button } from "@simpleapps-com/augur-web/button";
40
+ import { Dialog, DialogContent, DialogTitle } from "@simpleapps-com/augur-web/dialog";
41
+ import { Card, CardHeader, CardContent } from "@simpleapps-com/augur-web/card";
42
+ ```
43
+
44
+ **Component conventions:** CVA variants, `React.forwardRef`, `asChild` via Radix Slot, `cn()` for class merging, `"use client"` preserved in build, `displayName` set, icons use `react-icons/lu`.
45
+
46
+ **Tailwind content detection:** Tailwind v4 auto-detects sources. If augur-web classes are missing, add `@source "../node_modules/@simpleapps-com/augur-web/dist";` to your CSS.
47
+
48
+ ## augur-hooks
49
+
50
+ React Query hooks and Zustand stores. Cross-platform (works in Next.js and React Native).
51
+
52
+ ```typescript
53
+ // Cross-platform
54
+ import { useItemPrice, useCartStore, useDebounce, AugurHooksProvider } from "@simpleapps-com/augur-hooks";
55
+ // Web only (DOM-dependent)
56
+ import { useIsMobile, useIsHydrated } from "@simpleapps-com/augur-hooks/web";
57
+ ```
58
+
59
+ **Hook triple pattern** — every query hook exports three things:
60
+ - `use<Name>(params, options?)` — client-side hook (reads SDK from provider context)
61
+ - `get<Name>Options(api, params)` — server-side prefetch (accepts SDK directly)
62
+ - `get<Name>Key(params)` — query key factory for cache invalidation
63
+
64
+ ```typescript
65
+ // Client
66
+ const { data } = useItemPrice(itemId, customerId, 1);
67
+
68
+ // Server prefetch (no React context)
69
+ await queryClient.prefetchQuery(getItemPriceOptions(api, itemId, customerId));
70
+
71
+ // Cache invalidation
72
+ queryClient.invalidateQueries({ queryKey: getItemPriceKey(itemId, customerId) });
73
+ ```
74
+
75
+ **queryFn override** — web consumers can route through cached server actions:
76
+
77
+ ```typescript
78
+ const { data } = useItemPrice(itemId, customerId, 1, {
79
+ queryFn: () => getCachedItemPrice(itemId, customerId, 1),
80
+ });
81
+ ```
82
+
83
+ **Cart hooks** use dependency injection — the package provides React Query orchestration (optimistic updates, invalidation, loading states), consumers inject site-specific mutation callbacks.
84
+
85
+ **Provider required:** All query hooks need `AugurHooksProvider` wrapping the app with an SDK instance.
86
+
87
+ ## augur-server
88
+
89
+ Server-side utilities for Next.js. Redis caching, auth factory, query client, environment detection.
90
+
91
+ ```typescript
92
+ import { cachedSdkCall, getServerQueryClient, isDev, sdkCall } from "@simpleapps-com/augur-server";
93
+ import { createAuthConfig } from "@simpleapps-com/augur-server/auth";
94
+ ```
95
+
96
+ **cachedSdkCall** wraps SDK calls with Redis caching (SHA-256 key hashing, per-method stats, fire-and-forget writes, circuit breaker). Falls through without caching if ioredis is not installed.
97
+
98
+ **createAuthConfig** — NextAuth 5 factory with dependency-injected callbacks:
99
+
100
+ ```typescript
101
+ export const { handlers, signIn, signOut, auth } = NextAuth(
102
+ createAuthConfig({
103
+ callbacks: { getUserProfile, cartHdrLookup }, // site-specific
104
+ defaultCustomerId: process.env.NEXT_PUBLIC_DEFAULT_CUSTOMER_ID,
105
+ }),
106
+ );
107
+ ```
108
+
109
+ **Site action registry** — `createServerSite()` creates a process-global singleton. Self-heals via three-tier fallback (globalThis → module cache → auto-init from env vars).
110
+
111
+ ## augur-tailwind
112
+
113
+ Tailwind v4 CSS theme. No `tailwind.config.ts` needed.
114
+
115
+ ```css
116
+ @import "tailwindcss";
117
+ @import "@simpleapps-com/augur-tailwind/base.css";
118
+ @plugin "tailwindcss-animate";
119
+ ```
120
+
121
+ Override brand with CSS variables: `--primary`, `--secondary`, `--radius`, etc. All HSL components (no wrapper).
122
+
123
+ ## What Stays Site-Specific
124
+
125
+ MUST NOT be replaced by packages:
126
+ - **Server actions** (`"use server"`) — site-specific business logic
127
+ - **Layout components** (Header, Footer, MainMenu) — brand-specific
128
+ - **Domain components** (ProductItem, CartTable, CategoryCard) — compose UI primitives
129
+ - **Auth callbacks** (`getUserProfile`, `cartHdrLookup`) — injected into `createAuthConfig`
130
+ - **Cart mutation callbacks** — depend on site-specific server actions
131
+ - **CSS variable overrides** — brand colors, fonts, radius
132
+ - **next.config** — image domains, redirects, security headers
133
+ - **Site integrations** — GA4, Maps, reCAPTCHA
134
+
135
+ ## Anti-Pattern Catalog
136
+
137
+ Custom code that duplicates package exports. When you see these in a site, replace with the package version.
138
+
139
+ | Custom Code | Replace With |
140
+ |-------------|-------------|
141
+ | `cn()` in `@/lib/utils` | `cn` from `augur-utils/web` |
142
+ | `formatPrice()` helpers | `formatPrice` from `augur-utils` |
143
+ | Local types (`@/types/T*`) | Types from `augur-utils` |
144
+ | Custom `CACHE_CONFIG` / inline TTLs | `CACHE_CONFIG` from `augur-utils` |
145
+ | `@/components/ui/*` imports | `augur-web/<component>` |
146
+ | Custom breadcrumb, quantity, pagination, form inputs | `augur-web/<component>` |
147
+ | Custom `useDebounce` | `useDebounce` from `augur-hooks` |
148
+ | Custom `useIsMobile` / `useIsHydrated` | From `augur-hooks/web` |
149
+ | Custom price/cart hooks or stores | From `augur-hooks` |
150
+ | Custom `cachedSdkCall` / SDK cache | `cachedSdkCall` from `augur-server` |
151
+ | Custom `getServerQueryClient` | From `augur-server` |
152
+ | Custom `isDev` / env detection | From `augur-server` |
153
+ | Manual NextAuth Credentials config | `createAuthConfig` from `augur-server/auth` |
154
+ | `lucide-react` / `@heroicons/react` | `react-icons/lu` |
155
+ | `tailwind.config.ts` (v3) | `augur-tailwind/base.css` CSS-first |
156
+
157
+ ## Platform Standard
158
+
159
+ - **Icons:** `react-icons/lu`
160
+ - **Tailwind:** v4, CSS-first via `augur-tailwind/base.css`
161
+ - **Validation:** Valibot (not Zod, not Yup)
162
+ - **Auth:** NextAuth 5 via `createAuthConfig()`
163
+ - **Reference site:** ampro-online
@@ -1,45 +1,89 @@
1
1
  ---
2
2
  name: github
3
- description: GitHub conventions for SimpleApps. Covers org structure, local project layout, wiki-as-docs workflow, issue creation, PR workflows, and gh CLI usage. Use when creating issues, PRs, setting up repos, or working with GitHub wikis.
3
+ description: GitHub conventions for SimpleApps. Covers org structure, git safety, issue creation, PR workflows, and gh CLI usage. Use when creating issues, PRs, or working with GitHub repos.
4
+ allowed-tools: Skill(project-defaults)
4
5
  ---
5
6
 
7
+ First, use Skill("project-defaults") to load the project layout.
8
+
6
9
  # GitHub
7
10
 
8
11
  ## Organization
9
12
 
10
- All SimpleApps repos live under the **`simpleapps-com`** GitHub org.
11
-
12
- Repository pattern: `simpleapps-com/<repo-name>`
13
+ All SimpleApps repos live under **`simpleapps-com`**. Pattern: `simpleapps-com/<repo-name>`
13
14
 
14
15
  ## Authentication
15
16
 
16
- Use the `gh` CLI for all GitHub operations:
17
-
18
17
  ```bash
19
- gh auth status # Check auth status
20
- gh auth setup-git # Configure gh as git credential helper
18
+ gh auth status # Check auth
19
+ gh auth setup-git # Fix git credential helper (run if push fails 401/403)
21
20
  ```
22
21
 
23
- If `git push` fails with 401/403, run `gh auth setup-git` to fix credentials.
22
+ ## Project Layout
24
23
 
25
- ## Key Topics
24
+ See `simpleapps:project-defaults` for the full directory layout, symlink setup, and permission defaults. Key point: the git repo is always at `repo/`. Use `git -C repo` for git operations from the project root.
26
25
 
27
- - **Wiki as context** — See `wiki-as-context.md` for why the wiki is the source of truth and how to write for both humans and AI agents.
28
- - **Project structure** — See `project-structure.md` for the `{project}/[repo|wiki]` layout, what goes where, and wiki conventions.
29
- - **Issues & pull requests** — See `issues-prs.md` for issue templates, PR commands, and cross-linking with Basecamp.
26
+ ## Wiki
30
27
 
31
- ## Quick Reference
28
+ See `simpleapps:wiki` for wiki conventions, token budget, and maintenance rules.
32
29
 
33
- ```bash
34
- # Pushing
35
- gh auth setup-git && git push origin <branch>
36
- git push origin <tag>
30
+ ## Git Safety
31
+
32
+ MUST NOT commit, push, create PRs, or merge unless the user explicitly asks. After making changes, report what was done and stop. Do not offer or suggest the next git action wait for instructions.
33
+
34
+ - **Commits**: Do not commit until the user says "commit" or equivalent
35
+ - **Pushes**: Do not push until the user explicitly asks
36
+ - **PRs**: Do not create or offer to create a PR — report the work, stop
37
+ - **Merges**: Do not merge unless the user explicitly asks
38
+
39
+ The pattern is always: **do the work → report results → wait**.
40
+
41
+ ## Issues
42
+
43
+ MUST use `--repo simpleapps-com/<repo>` on every `gh` call. MUST ask the user which repo — never assume.
44
+
45
+ ### Title
46
+
47
+ Conventional commit style: `fix: description`, `feat: description`, `chore: description`. Under 70 characters.
48
+
49
+ ### Body
50
+
51
+ ```markdown
52
+ ## Problem
53
+ What is broken, missing, or needed?
37
54
 
38
- # Issues
55
+ ## Expected Behavior
56
+ What SHOULD happen instead?
57
+
58
+ ## Acceptance Criteria
59
+ - [ ] Concrete, testable criteria
60
+
61
+ ## Context
62
+ Related issues, affected files, workarounds, reproduction steps.
63
+ ```
64
+
65
+ Bug reports also include **Steps to Reproduce** and **Current Behavior** with error messages.
66
+
67
+ ### Commands
68
+
69
+ ```bash
39
70
  gh issue create --repo simpleapps-com/<repo> --title "type: desc" --body "..."
40
71
  gh issue list --repo simpleapps-com/<repo>
72
+ gh issue view <number> --repo simpleapps-com/<repo>
73
+ gh issue close <number> --repo simpleapps-com/<repo> --comment "message"
74
+ ```
75
+
76
+ Include `Closes #N` in commit body to auto-close issues.
77
+
78
+ ## Pull Requests
41
79
 
42
- # PRs
80
+ ```bash
43
81
  gh pr create --repo simpleapps-com/<repo> --title "title" --body "..."
44
82
  gh pr list --repo simpleapps-com/<repo>
83
+ gh pr view <number> --repo simpleapps-com/<repo>
84
+ gh pr merge <number> --repo simpleapps-com/<repo>
45
85
  ```
86
+
87
+ ## Cross-Linking with Basecamp
88
+
89
+ For client tasks originating in Basecamp, see `simpleapps:workflow` for the full cross-linking process.
@@ -0,0 +1,91 @@
1
+ ---
2
+ name: project-defaults
3
+ description: SimpleApps project conventions. Covers directory layout, symlink setup for .claude integration, permission defaults (deny cd, kill), and per-project baseline settings. Use when setting up projects, checking structure, or configuring Claude Code defaults.
4
+ ---
5
+
6
+ # Project Defaults
7
+
8
+ ## Directory Layout
9
+
10
+ Every project MUST use this layout:
11
+
12
+ ```
13
+ {project}/
14
+ ├── .claude/ # Claude Code config (symlinks to repo/.claude/)
15
+ │ ├── rules/ # → repo/.claude/rules/
16
+ │ └── commands/ # → repo/.claude/commands/
17
+ ├── repo/ # Git repo (simpleapps-com/<name>.git)
18
+ ├── wiki/ # Wiki repo (simpleapps-com/<name>.wiki.git)
19
+ ├── wip/ # Work-in-progress files (not in git)
20
+ ├── tmp/ # Temporary files (not in git)
21
+ └── .simpleapps/ # Credentials (not in git)
22
+ ```
23
+
24
+ The parent `{project}/` is NOT a git repo — it keeps code and wiki side-by-side. The git repo is always at `repo/`. Use `git -C repo` for git operations from the project root.
25
+
26
+ | Content | Location | Examples |
27
+ |---------|----------|---------|
28
+ | Product code | `repo/` | Source, tests, configs, SKILL.md files |
29
+ | Dev documentation | `wiki/` | Architecture, guides, specs, conventions |
30
+ | Repo `.claude/rules/` | `repo/` | Minimal summaries referencing wiki |
31
+ | Repo `.claude/CLAUDE.md` | `repo/` | Quick reference + wiki links |
32
+ | Active task context | `wip/` | `{issue-number}-{short-desc}.md` files |
33
+ | Temporary files | `tmp/` | Throwaway files, scratch space, build artifacts |
34
+ | Project secrets | `{project}/.simpleapps/` | Site-specific credentials |
35
+ | Global secrets | `~/.simpleapps/` | Shared credentials across all projects |
36
+
37
+ **WIP**: Research, plans, decisions, test results. MUST NOT contain secrets, final docs, or code.
38
+
39
+ **Credentials**: Project-level (`.simpleapps/`) overrides user-level (`~/.simpleapps/`). MUST NOT be committed.
40
+
41
+ ## Symlink Setup
42
+
43
+ The repo contains `.claude/rules/` and `.claude/commands/` with project-specific rules and commands. To make these active from the project root (without starting Claude Code inside `repo/`), symlink them into the project-level `.claude/` folder:
44
+
45
+ ```bash
46
+ mkdir -p {project}/.claude
47
+ ln -sf ../repo/.claude/rules {project}/.claude/rules
48
+ ln -sf ../repo/.claude/commands {project}/.claude/commands
49
+ ```
50
+
51
+ This lets you run Claude Code from `{project}/` and still get the repo's rules and commands loaded automatically.
52
+
53
+ ## Permission Defaults
54
+
55
+ Every project SHOULD configure `.claude/settings.local.json` with these deny rules:
56
+
57
+ ```json
58
+ {
59
+ "permissions": {
60
+ "deny": [
61
+ "Bash(cd:*)",
62
+ "Bash(cat:*)",
63
+ "Bash(sed:*)",
64
+ "Bash(grep:*)",
65
+ "Bash(sleep:*)",
66
+ "Bash(kill:*)",
67
+ "Bash(pkill:*)"
68
+ ]
69
+ }
70
+ }
71
+ ```
72
+
73
+ Why each is denied:
74
+
75
+ - **`cd`** — Use `git -C` or tool-specific flags (`--repo`, `-C`) instead. `cd` loses working directory context.
76
+ - **`cat`** — Use the Read tool instead.
77
+ - **`sed`** — Use the Edit tool instead.
78
+ - **`grep`** — Use the Grep tool instead.
79
+ - **`sleep`** — Unnecessary; use proper sequencing or background tasks.
80
+ - **`kill`/`pkill`** — Use `TaskStop` to manage background processes. For internal tasks running in the background (dev servers, watchers, etc.), always use `TaskStop` instead of shell kill commands. `TaskStop` cleanly shuts down the task and updates Claude Code's internal tracking.
81
+
82
+ ## New Project Setup
83
+
84
+ ```bash
85
+ mkdir {project} && cd {project}
86
+ git clone https://github.com/simpleapps-com/<name>.git repo
87
+ git clone https://github.com/simpleapps-com/<name>.wiki.git wiki
88
+ mkdir -p wip tmp .simpleapps .claude
89
+ ln -sf ../repo/.claude/rules .claude/rules
90
+ ln -sf ../repo/.claude/commands .claude/commands
91
+ ```
@@ -0,0 +1,74 @@
1
+ ---
2
+ name: wiki
3
+ description: Wiki conventions for SimpleApps projects. Covers token budget, writing for three audiences, page conventions, maintenance rules, and git workflow. Use when reading, writing, or auditing wiki content.
4
+ ---
5
+
6
+ # Wiki
7
+
8
+ The wiki is the **single source of truth** for how a project works. The wiki is the spec; the repo is the implementation.
9
+
10
+ ## Token Budget
11
+
12
+ A wiki MUST NOT exceed **20K tokens** (~15K words, ~60KB). This is 10% of the AI agent's 200K context window — enough for the agent to load the entire wiki at session start while leaving 90% for working context.
13
+
14
+ Check size: `wc -w wiki/*.md` (multiply by ~1.3 for token estimate)
15
+
16
+ ## Core Principle
17
+
18
+ Repo files (`.claude/CLAUDE.md`, `.claude/rules/`, `README.md`) MUST be minimal — orient then point to wiki. AI agents read wiki pages as local files via `Read wiki/<page>.md`. No network requests needed.
19
+
20
+ ```
21
+ Wiki defines → Code implements → Learnings update wiki → Repeat
22
+ ```
23
+
24
+ When code reveals the wiki is wrong or incomplete, update immediately. The wiki MUST reflect reality, not aspirations.
25
+
26
+ ## Three Audiences
27
+
28
+ Every page serves junior devs (explanations, examples), senior devs (quick reference, decisions), and AI agents (unambiguous specs, MUST/SHOULD/MAY). Write for all three:
29
+
30
+ - Lead with a summary — seniors and agents get it fast, juniors get orientation
31
+ - Explain *why* before *how*
32
+ - Use tables for reference, code blocks for copy-paste, RFC 2119 keywords for requirements
33
+ - Each page SHOULD be self-contained
34
+ - Follow `simpleapps:writing-style` — token-efficient, action verbs first, no filler
35
+
36
+ ## Content Rules
37
+
38
+ - Wiki pages SHOULD NOT contain raw code. Describe patterns and principles instead.
39
+ - If implementation details are needed, link to the source file in `repo/` rather than duplicating code in the wiki.
40
+ - The wiki documents *what* and *why*. The repo is the source of truth for *how*.
41
+
42
+ ## Conventions
43
+
44
+ - Page naming: **PascalCase** with hyphens (`Getting-Started.md`)
45
+ - Every wiki MUST have `_Sidebar.md` for navigation
46
+ - Links: `[[Page-Name]]` or `[[Display Text|Page-Name]]`
47
+ - Anchor links MUST target specific sections (`[[Versioning#version-bump-procedure]]`), not just pages
48
+ - Repo references: use relative paths (`../../../wiki/Versioning.md`)
49
+ - Default branch: `master` (not `main`)
50
+
51
+ ## Keep It Lean
52
+
53
+ - Document patterns and principles, not exhaustive lists
54
+ - No hardcoded counts, no pinned versions, no full export inventories
55
+ - Describe the pattern, give 1-2 examples, point to source for current list
56
+ - Merge overlapping pages, archive obsolete ones
57
+
58
+ ## Maintenance
59
+
60
+ Cross-check wiki against code before updating. Staleness-prone: versions, file counts, CI workflows, TODO markers, API surfaces. **Never echo what the wiki says — read the code, then write.**
61
+
62
+ When adding/removing pages, MUST update: `Home.md`, `_Sidebar.md`, `llms.txt` (if present).
63
+
64
+ **Lead-site wikis** (e.g., ampro-online) serve as platform reference. Tag sections **(platform pattern)** vs **(site-specific)** so agents on other sites know what to replicate vs customize.
65
+
66
+ ## Git Workflow
67
+
68
+ The wiki is a separate git repo at `wiki/`. No branch protection, no PRs.
69
+
70
+ ```bash
71
+ git -C wiki add -A
72
+ git -C wiki commit -m "docs: describe the change"
73
+ git -C wiki push
74
+ ```
@@ -1,89 +0,0 @@
1
- # Issues & Pull Requests
2
-
3
- ## Issues
4
-
5
- ### Creating Issues
6
-
7
- MUST always use `--repo simpleapps-com/<repo>` to target the correct org. MUST ask the user which repo to create the issue in — never assume.
8
-
9
- ### Issue Title
10
-
11
- - Use conventional commit style: `fix: description`, `feat: description`, `chore: description`
12
- - SHOULD be a technical description, not the client's words
13
- - Keep under 70 characters
14
-
15
- ### Issue Body
16
-
17
- Every issue MUST include these sections:
18
-
19
- ```markdown
20
- ## Problem
21
- What is broken, missing, or needed? Include error messages, URLs, or screenshots if relevant.
22
-
23
- ## Expected Behavior
24
- What SHOULD happen instead? Be specific.
25
-
26
- ## Acceptance Criteria
27
- - [ ] Concrete, testable criteria
28
- - [ ] Each item is independently verifiable
29
-
30
- ## Context
31
- Any additional info: related issues, affected files, workarounds, reproduction steps.
32
- ```
33
-
34
- For bug reports, also include:
35
- - **Steps to Reproduce** — numbered steps to trigger the bug
36
- - **Current Behavior** — what actually happens (with error messages)
37
-
38
- ### Labels
39
-
40
- Use labels to categorize: `bug`, `feature`, `enhancement`
41
-
42
- ### Example
43
-
44
- ```bash
45
- gh issue create --repo simpleapps-com/<repo> \
46
- --title "fix: search endpoint returns 404" \
47
- --body "$(cat <<'ISSUE'
48
- ## Problem
49
- The `search` MCP tool returns HTTP 404 on every query. This prevents finding content across projects.
50
-
51
- ## Expected Behavior
52
- Search SHOULD return matching results, consistent with the Basecamp web UI.
53
-
54
- ## Acceptance Criteria
55
- - [ ] Search returns results for known content
56
- - [ ] Error handling for empty results
57
-
58
- ## Context
59
- BCX API may not expose a search endpoint. Web UI search at `/search?q=...` works.
60
- ISSUE
61
- )"
62
- ```
63
-
64
- ### Managing Issues
65
-
66
- ```bash
67
- gh issue list --repo simpleapps-com/<repo> # List open issues
68
- gh issue list --repo simpleapps-com/<repo> --state all # Include closed
69
- gh issue view <number> --repo simpleapps-com/<repo> # View issue details
70
- gh issue close <number> --repo simpleapps-com/<repo> # Close issue
71
- gh issue close <number> --repo simpleapps-com/<repo> --comment "message" # Close with comment
72
- ```
73
-
74
- ### Closing via Commit
75
-
76
- Include `Closes #N` in the commit message body to auto-close issues when pushed.
77
-
78
- ## Pull Requests
79
-
80
- ```bash
81
- gh pr create --repo simpleapps-com/<repo> --title "title" --body "description"
82
- gh pr list --repo simpleapps-com/<repo>
83
- gh pr view <number> --repo simpleapps-com/<repo>
84
- gh pr merge <number> --repo simpleapps-com/<repo>
85
- ```
86
-
87
- ## Cross-Linking with Basecamp
88
-
89
- When working on client tasks that originate in Basecamp, see the `simpleapps:workflow` skill for the full Basecamp-to-GitHub cross-linking process.
@@ -1,146 +0,0 @@
1
- # Project Structure & Wiki Workflow
2
-
3
- ## Local Layout
4
-
5
- Every project MUST use this layout:
6
-
7
- ```
8
- {project}/
9
- ├── repo/ # Main git repo (simpleapps-com/<name>.git)
10
- ├── wiki/ # GitHub wiki repo (simpleapps-com/<name>.wiki.git)
11
- ├── wip/ # Work-in-progress files for active tasks (not in git)
12
- └── .simpleapps/ # Project-level secrets and credentials (not in git)
13
- ```
14
-
15
- The parent `{project}/` directory is NOT a git repo — it's a local wrapper that keeps the code repo and wiki side-by-side. The `wip/` and `.simpleapps/` directories sit outside both git trees so their contents can never be accidentally committed.
16
-
17
- ## Why This Pattern
18
-
19
- - GitHub wikis are separate git repos. Cloning them alongside the code keeps everything local and searchable.
20
- - AI agents (Claude Code) can `Read` wiki files from disk instantly instead of fetching URLs.
21
- - The wiki becomes the **source of truth for dev docs**. The repo stays focused on product code.
22
-
23
- ## Setting Up a New Project
24
-
25
- ```bash
26
- mkdir {project}
27
- cd {project}
28
- git clone https://github.com/simpleapps-com/<name>.git repo
29
- git clone https://github.com/simpleapps-com/<name>.wiki.git wiki
30
- ```
31
-
32
- If the wiki repo doesn't exist yet, create it by adding any page via the GitHub wiki UI first, then clone.
33
-
34
- ## What Goes Where
35
-
36
- | Content | Location | Examples |
37
- |---------|----------|---------|
38
- | Product code | `repo/` | Source, tests, configs, SKILL.md files |
39
- | Dev documentation | `wiki/` | Architecture, guides, specs, conventions |
40
- | Repo README | `repo/README.md` | Minimal — quick start + link to wiki |
41
- | Repo `.claude/rules/` | `repo/` | Minimal summaries referencing wiki pages |
42
- | Repo `.claude/CLAUDE.md` | `repo/` | Quick reference + wiki links |
43
- | Active task context | `wip/` | WIP files for Basecamp todos or GitHub issues |
44
- | Project secrets | `{project}/.simpleapps/` | Site-specific credentials, `{siteId}.json` |
45
- | Global secrets | `~/.simpleapps/` | Shared credentials across all projects |
46
-
47
- Rule of thumb: if a `.md` file isn't built into the end product, it belongs in the wiki. If it contains secrets or ephemeral task state, it belongs outside both git trees.
48
-
49
- ## WIP Directory
50
-
51
- The `wip/` directory holds work-in-progress files that AI agents create when picking up tasks from Basecamp or GitHub issues. Each file tracks research, plans, and progress for an active task.
52
-
53
- ### Naming Convention
54
-
55
- `{issue-number}-{short-description}.md` — e.g., `14-basecamp-mcp-auto-refresh-oauth.md`
56
-
57
- ### Lifecycle
58
-
59
- 1. Agent picks up a Basecamp todo or GitHub issue
60
- 2. Creates a WIP file with research findings and implementation plan
61
- 3. Updates the file as work progresses
62
- 4. File remains after completion as a record of decisions made
63
-
64
- ### What belongs in WIP
65
-
66
- - Research findings and code analysis
67
- - Detailed implementation plans
68
- - Decision rationale
69
- - Test results and verification notes
70
-
71
- ### What does NOT belong in WIP
72
-
73
- - Secrets, credentials, or tokens (use `.simpleapps/`)
74
- - Final documentation (use `wiki/`)
75
- - Code (use `repo/`)
76
-
77
- ## Credentials (`.simpleapps/`)
78
-
79
- Secrets and credentials live in `.simpleapps/` directories at two levels:
80
-
81
- - **`~/.simpleapps/`** (user-level) — shared credentials across all projects (e.g., `augur-api.json`, `basecamp.json`)
82
- - **`{project}/.simpleapps/`** (project-level) — credentials specific to that project (e.g., `{siteId}.json` with test user creds)
83
-
84
- Project-level credentials override user-level ones when both exist. Both directories sit outside git trees so nothing can be accidentally committed.
85
-
86
- MUST NOT be committed to any git repository. MUST NOT be copied into `repo/` or `wiki/`.
87
-
88
- ## Referencing Wiki from Repo
89
-
90
- Repo files SHOULD use **relative filesystem paths** to reference wiki content:
91
-
92
- ```markdown
93
- Full docs: ../../../wiki/Versioning.md
94
- ```
95
-
96
- Relative paths work for Claude Code (local file reads). GitHub URLs require network access and are slower.
97
-
98
- ## Wiki Conventions
99
-
100
- ### Page Naming
101
-
102
- - Use **PascalCase** with hyphens: `Getting-Started.md`, `Plugin-Structure.md`
103
- - Match the pattern used in GitHub wiki URLs: `wiki/Page-Name`
104
-
105
- ### _Sidebar.md
106
-
107
- Every wiki MUST have a `_Sidebar.md` for navigation. Group pages by topic:
108
-
109
- ```markdown
110
- **[[Home]]**
111
-
112
- **Getting Started**
113
- - [[Getting-Started]]
114
-
115
- **Architecture**
116
- - [[Architecture]]
117
- - [[Plugin-Structure]]
118
-
119
- **Development**
120
- - [[Development]]
121
- - [[Versioning]]
122
- ```
123
-
124
- ### Linking
125
-
126
- - Use `[[Page-Name]]` wiki links for internal links (renders on GitHub wiki)
127
- - Use `[[Display Text|Page-Name]]` for custom link text
128
-
129
- ### Content Guidelines
130
-
131
- - Wiki pages are the **full, detailed** version of documentation
132
- - Each page SHOULD be self-contained — don't assume the reader has seen other pages
133
- - Include examples, code blocks, and tables where they help
134
- - Use RFC 2119 keywords (MUST/SHOULD/MAY) for requirements
135
-
136
- ### Committing Wiki Changes
137
-
138
- The wiki is a regular git repo. Commit and push like any other:
139
-
140
- ```bash
141
- cd {project}/wiki
142
- git add -A && git commit -m "docs: add architecture page"
143
- git push origin master
144
- ```
145
-
146
- Note: GitHub wikis typically use `master` as the default branch, not `main`.
@@ -1,162 +0,0 @@
1
- # Wiki as Context
2
-
3
- The GitHub wiki is the **single source of truth** for how a project works. It is not an afterthought or a place to dump notes — it is the primary context that drives development.
4
-
5
- ## The Problem
6
-
7
- Documentation scattered across a codebase creates friction:
8
-
9
- - `.claude/rules/` files, README.md, inline comments, and docs/ folders all compete as sources of truth
10
- - AI agents waste tokens reading large files to find relevant context
11
- - New team members don't know where to look
12
- - Docs rot because they live next to code and get forgotten
13
-
14
- ## The Solution
15
-
16
- The wiki is the **spec**. The repo is the **implementation**.
17
-
18
- | Wiki | Repo |
19
- |------|------|
20
- | Architecture decisions | Code that implements them |
21
- | API specs | API code |
22
- | Conventions and standards | Code that follows them |
23
- | Onboarding guides | Nothing — wiki is self-contained |
24
- | Release processes | Automation scripts |
25
- | Full explanations | Minimal pointers back to wiki |
26
-
27
- ## How It Works
28
-
29
- ### 1. Wiki First
30
-
31
- When starting new work, check the wiki first. If the wiki doesn't cover it, write the wiki page before writing code. The wiki defines *what* and *why*. The code implements *how*.
32
-
33
- ### 2. Repo References Wiki
34
-
35
- Repo files (`.claude/CLAUDE.md`, `.claude/rules/`, `README.md`) SHOULD be **minimal** — just enough to orient, then point to the wiki for details.
36
-
37
- ```markdown
38
- # Versioning
39
-
40
- Full docs: ../../../wiki/Versioning.md
41
-
42
- `VERSION` file = source of truth. All version fields MUST match.
43
- ```
44
-
45
- ### 3. AI Agents Read Wiki Locally
46
-
47
- Because the wiki is cloned alongside the repo (see `project-structure.md`), AI agents read wiki pages as local files. No network requests, no URL fetching — just `Read ../../../wiki/Architecture.md`.
48
-
49
- This means wiki pages are both human documentation AND machine context.
50
-
51
- ### 4. Wiki Evolves with the Project
52
-
53
- The wiki is not write-once. As the codebase changes:
54
-
55
- - Update affected wiki pages in the same work session
56
- - Add new pages when new patterns emerge
57
- - Remove pages when features are deprecated
58
- - Keep the `_Sidebar.md` current
59
-
60
- ## Three Audiences
61
-
62
- Every wiki page serves three audiences simultaneously:
63
-
64
- | Audience | What they need | How they read |
65
- |----------|---------------|---------------|
66
- | **Junior devs** | Explanations of *why*, step-by-step instructions, examples they can copy | Top to bottom, following links for context |
67
- | **Senior devs** | Quick reference, architecture decisions, conventions to follow | Scan for the section they need, skip the rest |
68
- | **AI agents** | Unambiguous specs, exact commands, clear requirements (MUST/SHOULD/MAY) | Load the full wiki into context, act on it |
69
-
70
- ### Writing for All Three
71
-
72
- - **Lead with a summary** — seniors and agents get what they need fast, juniors get orientation
73
- - **Explain the *why* before the *how*** — juniors learn the reasoning, seniors confirm their assumptions, agents get decision context
74
- - **Use tables for reference data** — scannable for seniors, parseable for agents, structured for juniors
75
- - **Use code blocks for anything copy-pasteable** — all three audiences benefit from exact commands
76
- - **Use RFC 2119 keywords (MUST/SHOULD/MAY)** — removes ambiguity for everyone, especially agents
77
- - **Include examples** — juniors learn by example, agents use them as patterns
78
-
79
- ### Keep Pages Self-Contained
80
-
81
- Each page SHOULD make sense on its own. A junior dev landing on any page SHOULD be able to understand it without reading the rest of the wiki.
82
-
83
- ### Follow the Writing Style Skill
84
-
85
- All wiki content MUST follow the `simpleapps:writing-style` skill:
86
-
87
- - **RFC 2119 keywords** — MUST/SHOULD/MAY in ALL CAPS for requirements, lowercase for casual suggestions
88
- - **Token efficiency** — action verbs first, no filler, specific over generic, Bottom Line Up Front
89
- - **Developer-facing tone** — technical and concise, include file references and acceptance criteria
90
- - **Expand for onboarding and architecture** — juniors and future devs need the "why"
91
- - **Cut everywhere else** — two sentences that answer the question beat two pages that fill the context window
92
-
93
- The wiki is developer-facing documentation. It is NOT client-facing. Write for devs and AI agents, not for non-technical readers.
94
-
95
- ### Link with Anchor Precision
96
-
97
- When referencing other wiki pages, MUST link directly to the relevant section using `#` anchors — not just the page.
98
-
99
- ```markdown
100
- # Good — links to exact section
101
- See [[Versioning#version-bump-procedure]] for the step-by-step process.
102
- Check [[Architecture#three-layers]] for how marketplace, plugins, and CLI relate.
103
-
104
- # Bad — links to top of page, reader has to hunt
105
- See [[Versioning]] for details.
106
- Check [[Architecture]] for more info.
107
- ```
108
-
109
- This matters for two reasons:
110
- - **Devs** jump straight to the answer instead of scrolling through a page
111
- - **AI agents** use anchor links as an attention signal — a `#section` reference tells the agent exactly which part of a page is relevant to the current task, reducing noise in a 20K token wiki
112
-
113
- ### The 20K Token Budget
114
-
115
- The entire wiki MUST stay under **20K tokens** (~60KB of markdown). This is a hard constraint, not a guideline.
116
-
117
- Why 20K: with a 200K token context window, the full wiki never exceeds 10% of available context. This means an AI agent can load the **entire wiki** into active context at the start of a session and keep it there throughout. No selective loading, no missed context, no stale references — the agent always has the complete picture.
118
-
119
- If the wiki approaches the budget:
120
- - Tighten language — cut filler, use tables over prose
121
- - Merge overlapping pages
122
- - Move implementation details back to code comments where they belong
123
- - Archive obsolete pages (delete, don't hoard)
124
-
125
- To check the current budget:
126
- ```bash
127
- wc -c {project}/wiki/*.md
128
- ```
129
-
130
- Rough conversion: 1 token ≈ 3 bytes of markdown. So 20K tokens ≈ 60KB.
131
-
132
- ### Right-Size Each Page
133
-
134
- - Too short = missing context, agent has to search elsewhere
135
- - Too long = wasted tokens, buried signal
136
- - Target: enough to act on without reading anything else
137
-
138
- ## The Feedback Loop
139
-
140
- ```
141
- Wiki defines → Code implements → Learnings update wiki → Repeat
142
- ```
143
-
144
- When code reveals that the wiki is wrong or incomplete, update the wiki immediately. The wiki MUST reflect reality, not aspirations.
145
-
146
- ## When to Update the Wiki
147
-
148
- - **New feature** — Write the wiki page first (spec), then implement
149
- - **Bug fix** — If the fix reveals a gap in documentation, update the wiki
150
- - **Architecture change** — Update Architecture page before or during the change
151
- - **New convention** — Add to the relevant wiki page so the team adopts it
152
- - **Onboarding friction** — If someone asks "where is X?", the answer should be a wiki link. If it's not, create the page.
153
-
154
- ## Anti-Patterns
155
-
156
- | Don't | Do |
157
- |-------|-----|
158
- | Write long README.md files in the repo | Minimal README + wiki link |
159
- | Duplicate wiki content in `.claude/rules/` | Thin rules that reference wiki |
160
- | Leave wiki pages stale after code changes | Update wiki in the same session |
161
- | Use the wiki as a dumping ground for notes | Structure pages with clear purpose |
162
- | Write wiki pages only humans can understand | Write for both humans and AI agents |