thomas-agentkit 0.1.0

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/README.md ADDED
@@ -0,0 +1,104 @@
1
+ # AgentKit CLI
2
+
3
+ AgentKit CLI bootstraps AI-agent-ready repositories.
4
+
5
+ It installs reusable instructions, planning templates, review docs, design system rules, and workflow guidance for developers using Codex, Cursor, GitHub Copilot, Claude Code, and similar coding agents.
6
+
7
+ AgentKit is not an AI agent. It is a small scaffolding tool for making repositories easier and safer to work on with AI-assisted development.
8
+
9
+ ## Usage
10
+
11
+ Install templates into the current directory:
12
+
13
+ ```bash
14
+ npx thomas-agentkit init
15
+ ```
16
+
17
+ Install into another directory:
18
+
19
+ ```bash
20
+ npx thomas-agentkit init ./my-project
21
+ ```
22
+
23
+ Preview changes without writing files:
24
+
25
+ ```bash
26
+ npx thomas-agentkit init --dry-run
27
+ ```
28
+
29
+ Overwrite existing files:
30
+
31
+ ```bash
32
+ npx thomas-agentkit init --force
33
+ ```
34
+
35
+ Use the optional interactive flow:
36
+
37
+ ```bash
38
+ npx thomas-agentkit init --interactive
39
+ ```
40
+
41
+ List bundled templates:
42
+
43
+ ```bash
44
+ npx thomas-agentkit --list
45
+ ```
46
+
47
+ ## Installed Files
48
+
49
+ AgentKit copies these bundled files into the target project:
50
+
51
+ - `AGENTS.md`
52
+ - `CLAUDE.md`
53
+ - `CODE-QUALITY.md`
54
+ - `DESIGN-SYSTEM.md`
55
+ - `IMPLEMENTATION-BRIEF-TEMPLATE.md`
56
+ - `PRD-TEMPLATE.md`
57
+ - `WORKFLOWS.md`
58
+ - `.cursor/rules/agentkit.md`
59
+ - `.github/copilot-instructions.md`
60
+ - `.github/pull_request_template.md`
61
+
62
+ Existing files are skipped by default so local edits are preserved. Use `--force` when you intentionally want to refresh files from the bundled package version.
63
+
64
+ ## CLI Reference
65
+
66
+ ```text
67
+ agentkit init [target] [--force] [--dry-run] [--interactive] [--yes]
68
+ agentkit --list
69
+ agentkit --help
70
+ agentkit --version
71
+ ```
72
+
73
+ Options:
74
+
75
+ - `--force`: overwrite existing files
76
+ - `--dry-run`: print planned changes without writing files
77
+ - `-i, --interactive`: prompt for install options
78
+ - `-y, --yes`: accept defaults for non-interactive runs
79
+ - `--list`: list bundled template files
80
+ - `-h, --help`: show help
81
+ - `-v, --version`: show package version
82
+
83
+ ## Local Development
84
+
85
+ ```bash
86
+ npm install
87
+ npm run dev -- init ./tmp-demo --dry-run
88
+ npm run build
89
+ npm test
90
+ ```
91
+
92
+ The npm package is `thomas-agentkit`. The installed CLI command is `agentkit`, backed by the compiled TypeScript entrypoint at `dist/cli.js`.
93
+
94
+ ## Philosophy
95
+
96
+ AgentKit should stay:
97
+
98
+ - simple
99
+ - practical
100
+ - easy to inspect
101
+ - easy to modify
102
+ - safe by default
103
+ - useful immediately
104
+ - not overengineered
package/dist/cli.js ADDED
@@ -0,0 +1,143 @@
1
+ #!/usr/bin/env node
2
+ import { confirm, isCancel, text } from "@clack/prompts";
3
+ import { Command } from "commander";
4
+ import { constants as fsConstants } from "node:fs";
5
+ import { access, copyFile, mkdir, readdir, readFile, stat } from "node:fs/promises";
6
+ import path from "node:path";
7
+ import { fileURLToPath } from "node:url";
8
+ const __filename = fileURLToPath(import.meta.url);
9
+ const __dirname = path.dirname(__filename);
10
+ const packageRoot = path.resolve(__dirname, "..");
11
+ const templatesDir = path.join(packageRoot, "templates");
12
+ const packageJsonPath = path.join(packageRoot, "package.json");
13
+ async function exists(filePath) {
14
+ try {
15
+ await access(filePath, fsConstants.F_OK);
16
+ return true;
17
+ }
18
+ catch {
19
+ return false;
20
+ }
21
+ }
22
+ async function readPackageVersion() {
23
+ const packageJson = JSON.parse(await readFile(packageJsonPath, "utf8"));
24
+ return packageJson.version ?? "0.0.0";
25
+ }
26
+ async function getTemplateFiles(dir = templatesDir, base = templatesDir) {
27
+ const dirStat = await stat(dir);
28
+ if (!dirStat.isDirectory()) {
29
+ throw new Error(`Bundled templates directory not found: ${templatesDir}`);
30
+ }
31
+ const entries = await readdir(dir, { withFileTypes: true });
32
+ const files = await Promise.all(entries.map(async (entry) => {
33
+ const absolutePath = path.join(dir, entry.name);
34
+ if (entry.isDirectory()) {
35
+ return getTemplateFiles(absolutePath, base);
36
+ }
37
+ if (!entry.isFile()) {
38
+ return [];
39
+ }
40
+ return [path.relative(base, absolutePath).split(path.sep).join("/")];
41
+ }));
42
+ return files.flat().sort();
43
+ }
44
+ async function installTemplates(targetArg, options) {
45
+ const targetDir = path.resolve(process.cwd(), targetArg || ".");
46
+ const files = await getTemplateFiles();
47
+ const created = [];
48
+ const skipped = [];
49
+ if (!options.dryRun) {
50
+ await mkdir(targetDir, { recursive: true });
51
+ }
52
+ for (const file of files) {
53
+ const source = path.join(templatesDir, file);
54
+ const destination = path.join(targetDir, file);
55
+ const destinationExists = await exists(destination);
56
+ if (destinationExists && !options.force) {
57
+ skipped.push(file);
58
+ continue;
59
+ }
60
+ created.push(file);
61
+ if (!options.dryRun) {
62
+ await mkdir(path.dirname(destination), { recursive: true });
63
+ await copyFile(source, destination);
64
+ }
65
+ }
66
+ return { targetDir, created, skipped };
67
+ }
68
+ function printInstallResult(result, dryRun = false) {
69
+ const action = dryRun ? "Would install" : "Installed";
70
+ console.log(`${action} AgentKit files in ${result.targetDir}`);
71
+ if (result.created.length > 0) {
72
+ console.log(`${dryRun ? "Would create" : "Created"}: ${result.created.join(", ")}`);
73
+ }
74
+ if (result.skipped.length > 0) {
75
+ console.log(`Skipped existing: ${result.skipped.join(", ")}`);
76
+ console.log("Use --force to overwrite existing files.");
77
+ }
78
+ if (result.created.length === 0 && result.skipped.length === 0) {
79
+ console.log("No bundled templates found.");
80
+ }
81
+ }
82
+ async function resolveInteractiveTarget(target, options) {
83
+ if (!options.interactive) {
84
+ return target;
85
+ }
86
+ const targetResponse = await text({
87
+ message: "Where should AgentKit install templates?",
88
+ placeholder: target || ".",
89
+ defaultValue: target || ".",
90
+ });
91
+ if (isCancel(targetResponse)) {
92
+ process.exit(130);
93
+ }
94
+ const forceResponse = await confirm({
95
+ message: "Overwrite existing files?",
96
+ initialValue: Boolean(options.force),
97
+ });
98
+ if (isCancel(forceResponse)) {
99
+ process.exit(130);
100
+ }
101
+ options.force = forceResponse;
102
+ return targetResponse || ".";
103
+ }
104
+ async function main() {
105
+ if (process.argv.slice(2).includes("--list")) {
106
+ const files = await getTemplateFiles();
107
+ for (const file of files) {
108
+ console.log(file);
109
+ }
110
+ return;
111
+ }
112
+ const program = new Command();
113
+ program
114
+ .name("agentkit")
115
+ .description("Bootstrap AI-agent-ready repository docs and workflow templates.")
116
+ .version(await readPackageVersion(), "-v, --version")
117
+ .option("--list", "list bundled template files")
118
+ .addHelpText("after", `
119
+
120
+ Examples:
121
+ agentkit init
122
+ agentkit init ./my-project --dry-run
123
+ agentkit --list`);
124
+ program
125
+ .command("init")
126
+ .description("install AgentKit templates into a project")
127
+ .argument("[target]", "target project directory", ".")
128
+ .option("--force", "overwrite existing files")
129
+ .option("--dry-run", "print planned changes without writing files")
130
+ .option("-i, --interactive", "prompt for install options")
131
+ .option("-y, --yes", "accept defaults for non-interactive runs")
132
+ .action(async (target, options) => {
133
+ const resolvedTarget = await resolveInteractiveTarget(target, options);
134
+ const result = await installTemplates(resolvedTarget, options);
135
+ printInstallResult(result, Boolean(options.dryRun));
136
+ });
137
+ await program.parseAsync(process.argv);
138
+ }
139
+ main().catch((error) => {
140
+ const message = error instanceof Error ? error.message : String(error);
141
+ console.error(message);
142
+ process.exitCode = 1;
143
+ });
package/package.json ADDED
@@ -0,0 +1,34 @@
1
+ {
2
+ "name": "thomas-agentkit",
3
+ "version": "0.1.0",
4
+ "description": "Install AI-agent-ready development templates into a project.",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "bin": {
8
+ "agentkit": "./dist/cli.js"
9
+ },
10
+ "files": [
11
+ "dist",
12
+ "templates",
13
+ "README.md"
14
+ ],
15
+ "scripts": {
16
+ "build": "tsc",
17
+ "dev": "tsx src/cli.ts",
18
+ "test": "vitest run",
19
+ "prepack": "npm run build"
20
+ },
21
+ "dependencies": {
22
+ "@clack/prompts": "^0.8.2",
23
+ "commander": "^12.1.0"
24
+ },
25
+ "devDependencies": {
26
+ "@types/node": "^22.10.2",
27
+ "tsx": "^4.19.2",
28
+ "typescript": "^5.7.2",
29
+ "vitest": "^4.1.5"
30
+ },
31
+ "engines": {
32
+ "node": ">=18"
33
+ }
34
+ }
@@ -0,0 +1,26 @@
1
+ # Cursor AgentKit Rules
2
+
3
+ Use these rules with Cursor agents and composer workflows.
4
+
5
+ ## Default Behavior
6
+
7
+ - Read `AGENTS.md` before implementation.
8
+ - Read `DESIGN-SYSTEM.md` before UI, styling, layout, navigation, or component work.
9
+ - Read `CODE-QUALITY.md` before review or refactor work.
10
+ - Create or update an implementation brief for complex work.
11
+
12
+ ## Implementation Rules
13
+
14
+ - Prefer the smallest complete solution.
15
+ - Reuse existing components, utilities, and patterns.
16
+ - Keep diffs focused and reviewable.
17
+ - Avoid speculative abstractions and dependency bloat.
18
+ - Do not change foundational theme, schema, or architecture without explicit approval.
19
+
20
+ ## Handoff
21
+
22
+ Always summarize:
23
+
24
+ - Files or areas changed.
25
+ - Checks run.
26
+ - Known risks or follow-up work.
@@ -0,0 +1,25 @@
1
+ # GitHub Copilot Instructions
2
+
3
+ Follow the repository rules in `AGENTS.md`, `CODE-QUALITY.md`, and `DESIGN-SYSTEM.md`.
4
+
5
+ ## Coding Style
6
+
7
+ - Prefer simple, maintainable, production-friendly code.
8
+ - Match existing project patterns.
9
+ - Keep changes small and explicit.
10
+ - Avoid adding dependencies unless the benefit is clear.
11
+ - Do not hardcode design tokens, colors, or font families in UI code.
12
+
13
+ ## Before Suggesting Code
14
+
15
+ - Inspect nearby code and reuse existing utilities or components.
16
+ - Preserve public APIs unless the task requires a change.
17
+ - Include validation at external boundaries.
18
+ - Include tests when behavior changes.
19
+
20
+ ## Avoid
21
+
22
+ - Speculative abstractions.
23
+ - Broad rewrites for narrow requests.
24
+ - Unrelated formatting churn.
25
+ - Placeholder logic that looks production-ready but is incomplete.
@@ -0,0 +1,19 @@
1
+ # Summary
2
+
3
+ - [What changed?]
4
+ - [Why?]
5
+
6
+ ## Checks
7
+
8
+ - [ ] Tests run or intentionally skipped
9
+ - [ ] Lint/build checks run or intentionally skipped
10
+ - [ ] Docs updated if behavior changed
11
+ - [ ] No unrelated formatting or refactor churn
12
+
13
+ ## Risk
14
+
15
+ [Known risks, limitations, or rollout notes.]
16
+
17
+ ## Screenshots / Demo
18
+
19
+ [Add screenshots, recordings, or notes for UI changes.]
@@ -0,0 +1,149 @@
1
+ # [Project Name] Agent Guide
2
+
3
+ ## Purpose
4
+
5
+ This file gives coding agents the project rules they need to work safely and consistently.
6
+
7
+ [Project Name] is [short project description]. Agents should optimize for fast iteration, low complexity, and production-ready delivery.
8
+
9
+ ## Guidelines
10
+
11
+ - Act like a high-performing senior engineer. Be concise, direct, decisive, and execution-focused.
12
+ - Solve problems with simple, maintainable, production-friendly solutions.
13
+ - Prefer low-complexity code that is easy to read, debug, and modify.
14
+ - Prefer the smallest path that fully satisfies the requirement.
15
+ - Do not overengineer. Do not introduce heavy abstractions, extra layers, broad fallbacks, or large dependencies for small features.
16
+ - Keep implementations clean, APIs small, behavior explicit, and naming clear.
17
+ - Avoid cleverness unless it clearly improves the outcome.
18
+ - Write code that another strong engineer can quickly understand, safely extend, and confidently ship.
19
+ - Treat user edits as intentional. Do not overwrite or revert work you did not make.
20
+
21
+ ## Do Not
22
+
23
+ - Do not add edge-case logic for scenarios outside the current requirements.
24
+ - Do not create new components, utilities, or abstractions before checking existing patterns.
25
+ - Do not introduce new dependencies without a clear production benefit.
26
+ - Do not make broad theme, schema, architecture, or formatting changes without explicit approval.
27
+ - Do not run destructive git commands unless explicitly asked.
28
+
29
+ ## Maintainability
30
+
31
+ Long-term maintainability is a core priority. Keep code direct and easy to change.
32
+
33
+ Extract shared logic when duplication is real or immediately likely, but do not create speculative abstractions. Do not be afraid to improve existing code when it helps the task, but avoid unrelated refactors.
34
+
35
+ ## Before Coding
36
+
37
+ Before making meaningful code changes:
38
+
39
+ 1. Check whether the task is linked to an issue in [issue tracker, e.g. Linear or GitHub Issues].
40
+ 2. For non-trivial work without an issue, ask whether one should be created before implementation.
41
+ 3. Create or switch to an appropriate branch:
42
+ - Prefer the branch generated by the issue tracker when available.
43
+ - Otherwise create a clear branch name, such as `feature/bookmark-dedupe` or `fix/auth-redirect`.
44
+ 4. Identify the smallest complete solution that satisfies the task.
45
+ 5. If the task touches UI, layout, styling, navigation, or components, read `[design system path, e.g. docs/design-system.md]`.
46
+ 6. If the task touches framework-specific or backend-specific code, read the local guidance for that system first.
47
+ 7. Inspect existing patterns before adding new ones.
48
+ 8. For complex or multi-file work, create a short PRD or implementation brief in `[briefs path, e.g. docs/briefs]` before implementation.
49
+
50
+ Tiny fixes do not need a branch-and-brief ceremony unless the project owner asks for it.
51
+
52
+ For complex work, the brief should include:
53
+
54
+ - Problem
55
+ - Scope
56
+ - Out of scope
57
+ - Acceptance criteria
58
+ - Implementation plan
59
+ - Files likely to change
60
+ - Risks
61
+ - Manual QA steps
62
+
63
+ ## During Coding
64
+
65
+ While implementing:
66
+
67
+ - Keep the diff small and reviewable.
68
+ - Prefer modifying existing patterns over inventing new ones.
69
+ - Avoid unrelated formatting churn.
70
+ - Keep behavior explicit.
71
+ - Add validation where external input enters the system.
72
+ - Follow `[design system path]` for UI work.
73
+ - Use semantic styling tokens instead of hardcoded colors or fonts.
74
+ - Preserve the project's established density, layout, and interaction patterns.
75
+ - Add loading, empty, error, disabled, and focus states where relevant.
76
+ - Add or update tests when touching pure logic, parsing, data transforms, search, AI output handling, or bug fixes.
77
+ - Preserve existing UX and styling unless the task asks for changes.
78
+
79
+ ## Before Finishing
80
+
81
+ Before marking work complete:
82
+
83
+ 1. Re-read the original task and acceptance criteria.
84
+ 2. Confirm the implementation satisfies the requested scope.
85
+ 3. Run the relevant checks:
86
+ - `[test command, e.g. npm test]`
87
+ - `[lint command, e.g. npm run lint]`
88
+ - `[build/check command, e.g. npm run build]` for larger changes
89
+ 4. Review the diff for unrelated changes.
90
+ 5. Confirm no unnecessary dependencies, schema changes, theme changes, or broad refactors were introduced.
91
+ 6. Provide a clear summary of the changes made.
92
+ 7. Mention:
93
+ - Files or areas changed
94
+ - Checks run
95
+ - Known risks or limitations
96
+ - Follow-up work, if any
97
+
98
+ ## Working Style
99
+
100
+ - Be concise, direct, and execution-focused.
101
+ - Prefer the smallest production-ready solution that fully meets the requirement.
102
+ - Keep code explicit, maintainable, and easy to modify.
103
+ - Avoid speculative abstractions, edge-case overengineering, and dependency bloat.
104
+ - Improve nearby code when helpful, but avoid unrelated refactors.
105
+ - Use existing UI primitives from `[UI component library or path]` before creating custom UI.
106
+ - Do not create reusable custom components unless the task actually needs them.
107
+ - Do not change global color tokens, theme colors, or foundational layout rules without explicit approval.
108
+
109
+ ## Project Commands
110
+
111
+ Replace these examples with the project's real commands:
112
+
113
+ | Command | Description |
114
+ | --- | --- |
115
+ | `npm run dev` | Start the local development server |
116
+ | `npm test` | Run tests |
117
+ | `npm run lint` | Run lint checks |
118
+ | `npm run build` | Build the project |
119
+
120
+ Remove commands that do not apply.
121
+
122
+ ## Environment
123
+
124
+ Document required environment variables here:
125
+
126
+ - `[ENV_VAR_NAME]`: [description]
127
+
128
+ Never commit API keys, tokens, private keys, or local `.env` values. Keep secrets in environment variables or the project-approved secret store.
129
+
130
+ ## Stack
131
+
132
+ Document the real stack for this project:
133
+
134
+ - [Primary framework]
135
+ - [Language/runtime]
136
+ - [Backend/data layer]
137
+ - [Styling system]
138
+ - [Test tools]
139
+ - [Lint/format tools]
140
+
141
+ ## Optional Framework Rules
142
+
143
+ Add project-specific rules here when a framework or backend has important local guidance.
144
+
145
+ Examples:
146
+
147
+ - Always read generated backend/framework guidance before editing generated or platform-specific code.
148
+ - Follow local generated patterns over generic assumptions.
149
+ - Keep schemas, validators, and API boundaries strict and explicit.
@@ -0,0 +1,44 @@
1
+ # CLAUDE.md
2
+
3
+ ## Purpose
4
+
5
+ Project guidance for Claude-based coding and agent workflows.
6
+
7
+ ## Local Commands
8
+
9
+ Replace these examples with the project’s real commands:
10
+
11
+ ```bash
12
+ npm install
13
+ npm test
14
+ npm run build
15
+ npm run lint
16
+ ```
17
+
18
+ ## Coding Standards
19
+
20
+ - Keep changes focused on the requested behavior.
21
+ - Prefer clear names and direct control flow.
22
+ - Avoid new abstractions until duplication or complexity justifies them.
23
+ - Preserve existing public interfaces unless the task requires a change.
24
+ - Update nearby documentation when behavior or setup changes.
25
+
26
+ ## Agent Development
27
+
28
+ - Document each agent’s goal, inputs, outputs, tools, and permission boundaries.
29
+ - Keep prompts and tool schemas versioned with the code that depends on them.
30
+ - Make failure modes explicit: retries, timeouts, partial results, and user-facing errors.
31
+ - Use deterministic tests for core orchestration logic.
32
+
33
+ ## Review And Verification
34
+
35
+ - Run the narrowest relevant test command first.
36
+ - For UI changes, verify responsive behavior and obvious accessibility states.
37
+ - For agent changes, test success, tool failure, invalid input, and timeout paths.
38
+ - Summarize verification results in the final handoff.
39
+
40
+ ## Secrets
41
+
42
+ - Use environment variables for local credentials.
43
+ - Do not paste secrets into prompts, logs, fixtures, or committed files.
44
+ - Provide `.env.example` entries for required variables without real values.
@@ -0,0 +1,62 @@
1
+ # Code Quality Guide
2
+
3
+ ## Purpose
4
+
5
+ This guide defines the baseline quality bar for changes in this repository.
6
+
7
+ Agents and contributors should optimize for code that is simple, readable, testable, and safe to modify.
8
+
9
+ ## Principles
10
+
11
+ - Prefer small, explicit changes over broad rewrites.
12
+ - Keep public APIs narrow and intentional.
13
+ - Use clear names and direct control flow.
14
+ - Avoid speculative abstractions and dependency bloat.
15
+ - Match existing project patterns before introducing new ones.
16
+ - Make failure modes explicit at system boundaries.
17
+
18
+ ## Review Checklist
19
+
20
+ - The change solves the stated problem and does not expand scope unexpectedly.
21
+ - The diff is small enough to review confidently.
22
+ - No unrelated formatting churn or broad refactors were introduced.
23
+ - New behavior has relevant tests or a clear reason tests were not added.
24
+ - External inputs are validated at boundaries.
25
+ - Errors are actionable and do not leak secrets.
26
+ - User-facing copy is clear and specific.
27
+ - UI changes include loading, empty, error, disabled, and focus states where relevant.
28
+
29
+ ## Testing Expectations
30
+
31
+ Run the narrowest useful checks first, then broaden verification for larger changes.
32
+
33
+ Document project commands here:
34
+
35
+ ```bash
36
+ npm test
37
+ npm run lint
38
+ npm run build
39
+ ```
40
+
41
+ Remove commands that do not apply.
42
+
43
+ ## Dependency Policy
44
+
45
+ Add a dependency only when it clearly reduces real complexity or improves correctness. Prefer existing project utilities and platform APIs for small features.
46
+
47
+ Before adding a dependency, confirm:
48
+
49
+ - The package is actively maintained.
50
+ - The API surface is small enough for the need.
51
+ - The behavior would be meaningfully harder or riskier to implement locally.
52
+ - The dependency does not create avoidable runtime, security, or bundle-size risk.
53
+
54
+ ## Handoff Standard
55
+
56
+ Every completed change should include:
57
+
58
+ - What changed.
59
+ - Why it changed.
60
+ - What checks were run.
61
+ - Known risks or limitations.
62
+ - Follow-up work, if any.
@@ -0,0 +1,229 @@
1
+ # [Project Name] Design System - Linear-Inspired Foundations
2
+
3
+ This design system codifies the visual and interaction principles for [Project Name].
4
+
5
+ It is the default source of truth for app shell layout, navigation, lists, controls, and page chrome in this repository.
6
+
7
+ All colors, typography families, and radii must be consumed through semantic tokens in `[theme stylesheet path, e.g. src/styles.css]` or a dedicated theme stylesheet imported there. Components must not hardcode literal color values or font family names.
8
+
9
+ ## 1) Surface And Color
10
+
11
+ ### Philosophy
12
+
13
+ The interface is a single continuous canvas. Separation comes from spacing, typography, and occasional structural seams, not stacked containers.
14
+
15
+ ### Token Roles
16
+
17
+ Define semantic CSS custom properties and map them to the project's theme tokens:
18
+
19
+ - `--background`: app canvas
20
+ - `--foreground`: primary text
21
+ - `--muted-foreground`: secondary/meta text
22
+ - `--border`: structural seams
23
+ - `--card`: elevated container for dialogs/popovers only
24
+ - `--popover`: overlay surfaces
25
+ - `--accent`: subtle hover/active in content areas
26
+ - `--sidebar`: sidebar canvas
27
+ - `--sidebar-accent`: hover/active in sidebar
28
+ - `--primary`: brand and primary CTA
29
+ - `--destructive`: danger actions
30
+ - `--ring`: focus ring
31
+
32
+ ### Rules
33
+
34
+ - No layered cards for routine content.
35
+ - No decorative gradients on product surfaces.
36
+ - Use one accent color, `--primary`, for brand and primary actions.
37
+ - Prefer spacing over background differentiation.
38
+ - Keep all colors tokenized and theme-ready for light and dark modes.
39
+
40
+ ## 2) Typography
41
+
42
+ ### Families
43
+
44
+ - Interface text: `font-sans` backed by `--font-sans`.
45
+ - Code, IDs, and timestamps: `font-mono` backed by `--font-mono`.
46
+
47
+ Do not reference literal font families in component files.
48
+
49
+ ### Scale
50
+
51
+ - Page heading: `text-xl`, `font-semibold`
52
+ - Section heading: `text-base`, `font-semibold`
53
+ - Body / row label: `text-xs`, `font-normal` to `font-medium`
54
+ - Meta / secondary: `text-[11px]`, `font-normal`
55
+ - Nav section label: `text-[11px] uppercase tracking-wide`, `font-medium`
56
+ - Tiny helper: `text-[10px]`, `font-normal`
57
+
58
+ ### Rules
59
+
60
+ - Headlines are quiet and utilitarian.
61
+ - Keep line height tight with `leading-tight` or `leading-snug` for dense UI.
62
+ - Reserve uppercase for nav labels and compact metadata.
63
+
64
+ ## 3) Navigation
65
+
66
+ ### Structure
67
+
68
+ 1. Header row: identity, search, and create action.
69
+ 2. Primary links.
70
+ 3. Collapsible grouped links.
71
+ 4. Lightweight footer affordance for help or docs.
72
+
73
+ ### Item Styling
74
+
75
+ - Default: `text-xs`, muted foreground.
76
+ - Hover: subtle `sidebar-accent` background.
77
+ - Active: full-width pill, medium weight.
78
+ - Icon size: 12px.
79
+ - Nav pill baseline: `rounded-full h-7 px-2.5`.
80
+
81
+ ### Collapse Behavior
82
+
83
+ - Expanded width: `15rem` or 240px.
84
+ - Collapsed width: `3rem` or 48px, icon-only with tooltip.
85
+ - Mobile: sheet/drawer using expanded width.
86
+ - Keyboard shortcut: support the project's standard sidebar toggle shortcut, e.g. `Cmd+B`.
87
+
88
+ ## 4) Layout Regions
89
+
90
+ ### App Shell
91
+
92
+ - Sidebar: fixed left, full viewport height, right seam border.
93
+ - Content: `flex-1 min-w-0`, same background canvas.
94
+ - Optional inspector: right panel, `22rem` to `28rem`, collapsible.
95
+
96
+ ### Common Page Patterns
97
+
98
+ - List workspace: toolbar plus scrollable list.
99
+ - Detail view: breadcrumbs/title plus body and optional inspector.
100
+ - Editor split: left rail plus center editor.
101
+ - Settings split: nav plus forms.
102
+
103
+ ### Toolbar Strip
104
+
105
+ - Height: `h-10` to `h-12`.
106
+ - Bottom seam: `border-b border-border/50`.
107
+ - No separate background block.
108
+
109
+ ## 5) Interactive Elements
110
+
111
+ ### Buttons
112
+
113
+ - Primary: solid `primary`.
114
+ - Secondary: neutral fill.
115
+ - Ghost: transparent with subtle hover fill.
116
+ - Destructive: `destructive` only for dangerous confirms.
117
+ - Icon-only: `size-8`, ghost, tooltip.
118
+
119
+ Rules:
120
+
121
+ - Default radius uses the tokenized radius scale.
122
+ - No shadows on standard buttons.
123
+ - Primary buttons are intentionally sparse.
124
+
125
+ ### Inputs
126
+
127
+ - Compact defaults: `h-8`; dense contexts: `h-7`.
128
+ - Tokenized input background and border.
129
+ - Visible focus ring: `ring-2 ring-ring`.
130
+ - Labels above fields. Do not use floating labels by default.
131
+
132
+ ### Menus / Popovers / Dialogs
133
+
134
+ - Tokenized `popover` surface and subtle border.
135
+ - Tight typography: `text-xs`.
136
+ - Compact spacing.
137
+ - Dialog actions align right: secondary then primary.
138
+
139
+ ## 6) Lists And Data
140
+
141
+ ### Row Anatomy
142
+
143
+ - Compact, single-line by default.
144
+ - Hover uses subtle accent fill.
145
+ - Selected row uses stronger accent fill and medium weight.
146
+ - Avoid per-row borders; separate by spacing and padding rhythm.
147
+
148
+ ### Grouping And Tables
149
+
150
+ - Group labels are muted; children are indented.
151
+ - Table headers use uppercase compact meta style.
152
+ - No zebra striping or heavy gridlines.
153
+
154
+ ## 7) Status And Feedback
155
+
156
+ - Status: small dots or icons with semantic meaning.
157
+ - Loading: skeletons for content, spinners only for inline actions.
158
+ - Toasts: non-intrusive, auto-dismiss.
159
+ - Empty states: icon, short message, and optional single CTA.
160
+
161
+ ## 8) Motion
162
+
163
+ - Motion confirms state changes; it is never decorative.
164
+ - Micro interactions: about 150ms.
165
+ - Layout shifts: about 200-250ms.
166
+ - Preferred easing: `cubic-bezier(0.16, 1, 0.3, 1)`.
167
+ - Respect `prefers-reduced-motion` with near-instant transitions.
168
+
169
+ ## 9) Spacing System
170
+
171
+ Base unit is 4px, using the project's spacing scale.
172
+
173
+ - `p-1` or 4px: tight internals.
174
+ - `p-2` or 8px: compact section padding.
175
+ - `p-3` or 12px: dense content blocks.
176
+ - `p-4` or 16px: page-level rhythm.
177
+
178
+ Density guidelines:
179
+
180
+ - Sidebar: dense, `h-7` rows.
181
+ - Content: moderate, `h-8` to `h-10` rows.
182
+ - Forms/settings: relaxed, `h-10` to `h-12` rows.
183
+
184
+ ## 10) Accessibility
185
+
186
+ - Full keyboard navigation for all controls.
187
+ - Consistent visible focus styles.
188
+ - Semantic landmarks such as `nav` and `main`.
189
+ - Collapsibles expose `aria-expanded`.
190
+ - Ensure WCAG AA contrast in both themes.
191
+
192
+ ## 11) Anti-Patterns
193
+
194
+ - Do not wrap normal content in elevated cards.
195
+ - Do not introduce multiple accent colors.
196
+ - Do not add decorative gradients behind core product surfaces.
197
+ - Do not stack multiple competing toolbars.
198
+ - Do not color-code nav icons.
199
+ - Do not hardcode colors or font families in components.
200
+
201
+ ## 12) Applying This System
202
+
203
+ ### Where Values Live
204
+
205
+ - Theme tokens and base layer: `[theme stylesheet path, e.g. src/styles.css]`.
206
+ - App shell composition: `[route/layout path, e.g. src/routes or app]`.
207
+ - Reusable UI primitives: `[components path, e.g. src/components/ui]`.
208
+
209
+ ### New Component Checklist
210
+
211
+ 1. Sits on canvas, not card-first?
212
+ 2. Uses 2-3 text hierarchy levels max?
213
+ 3. Has subtle hover and clear active states?
214
+ 4. Uses primary color only where needed?
215
+ 5. Uses spacing rhythm in 4px increments?
216
+ 6. Has complete keyboard and focus behavior?
217
+ 7. Uses token-driven colors and fonts?
218
+ 8. Works in light and dark themes?
219
+
220
+ ### For Coding Agents
221
+
222
+ - Read this file before changing UI, layout, navigation, styling, or components.
223
+ - Prefer existing UI primitives and local layout patterns.
224
+ - Do not introduce new visual language without documenting the reason in the implementation brief or PR.
225
+ - Before handoff, check responsive behavior, focus states, text overflow, loading states, empty states, and token usage.
226
+
227
+ ### Working Rule
228
+
229
+ Default to these principles unless a deliberate exception is documented in a feature-specific spec.
@@ -0,0 +1,49 @@
1
+ # Implementation Brief
2
+
3
+ ## Title
4
+
5
+ [Feature or fix name]
6
+
7
+ ## Problem
8
+
9
+ [What problem are we solving?]
10
+
11
+ ## Scope
12
+
13
+ - [In-scope item]
14
+ - [In-scope item]
15
+
16
+ ## Out Of Scope
17
+
18
+ - [Out-of-scope item]
19
+ - [Out-of-scope item]
20
+
21
+ ## Acceptance Criteria
22
+
23
+ - [ ] [Concrete scenario passes]
24
+ - [ ] [Concrete scenario passes]
25
+ - [ ] Relevant checks pass.
26
+
27
+ ## Implementation Plan
28
+
29
+ 1. [Step]
30
+ 2. [Step]
31
+ 3. [Step]
32
+
33
+ ## Files Likely To Change
34
+
35
+ - `[path]`: [reason]
36
+ - `[path]`: [reason]
37
+
38
+ ## Risks
39
+
40
+ - [Risk]: [mitigation]
41
+
42
+ ## Manual QA
43
+
44
+ - [Manual verification step]
45
+ - [Manual verification step]
46
+
47
+ ## Notes
48
+
49
+ [Useful context, links, or decisions.]
@@ -0,0 +1,70 @@
1
+ # PRD Template
2
+
3
+ ## Title
4
+
5
+ [Project or feature name]
6
+
7
+ ## Problem
8
+
9
+ Describe the user problem, business problem, or technical gap this work addresses.
10
+
11
+ ## Goals
12
+
13
+ - [Goal 1]
14
+ - [Goal 2]
15
+
16
+ ## Non-Goals
17
+
18
+ - [Out-of-scope item 1]
19
+ - [Out-of-scope item 2]
20
+
21
+ ## Users
22
+
23
+ - Primary user:
24
+ - Secondary users:
25
+ - Internal operators or reviewers:
26
+
27
+ ## Requirements
28
+
29
+ ### Functional
30
+
31
+ - [Required behavior]
32
+ - [Required behavior]
33
+
34
+ ### Non-Functional
35
+
36
+ - Performance:
37
+ - Reliability:
38
+ - Security:
39
+ - Accessibility:
40
+ - Observability:
41
+
42
+ ## UX Notes
43
+
44
+ - Primary workflow:
45
+ - Empty state:
46
+ - Error state:
47
+ - Permission or authentication state:
48
+
49
+ ## Technical Notes
50
+
51
+ - Systems touched:
52
+ - APIs or schemas:
53
+ - Data flow:
54
+ - Migration or compatibility concerns:
55
+
56
+ ## Risks
57
+
58
+ - [Risk and mitigation]
59
+ - [Risk and mitigation]
60
+
61
+ ## Acceptance Criteria
62
+
63
+ - [ ] [Concrete scenario passes]
64
+ - [ ] [Concrete scenario passes]
65
+ - [ ] Tests cover success and failure paths.
66
+
67
+ ## Open Questions
68
+
69
+ - [Question]
70
+ - [Question]
@@ -0,0 +1,54 @@
1
+ # Project Workflows
2
+
3
+ ## Purpose
4
+
5
+ This document defines lightweight workflows for planning, implementation, review, and release.
6
+
7
+ Keep this file practical. Delete sections that do not apply to the project.
8
+
9
+ ## Planning Workflow
10
+
11
+ Use a PRD for product or user-facing work that needs intent, requirements, and acceptance criteria.
12
+
13
+ Use an implementation brief for engineering work that is already understood but needs a clear execution plan.
14
+
15
+ Tiny fixes can skip formal planning when the change is obvious and low risk.
16
+
17
+ ## Branch Workflow
18
+
19
+ - Prefer an issue-linked branch when available.
20
+ - Use short, descriptive branch names:
21
+ - `feature/[short-name]`
22
+ - `fix/[short-name]`
23
+ - `chore/[short-name]`
24
+ - Keep each branch focused on one coherent change.
25
+
26
+ ## Coding Workflow
27
+
28
+ 1. Read the issue, PRD, or implementation brief.
29
+ 2. Inspect existing patterns.
30
+ 3. Make the smallest complete change.
31
+ 4. Add or update tests where behavior changes.
32
+ 5. Run relevant checks.
33
+ 6. Review the diff before handoff.
34
+
35
+ ## Review Workflow
36
+
37
+ Review for correctness first, then maintainability, tests, UX, and style.
38
+
39
+ Call out:
40
+
41
+ - Bugs or regressions.
42
+ - Missing validation or error handling.
43
+ - Overly broad abstractions.
44
+ - Missing tests for changed behavior.
45
+ - UI states that are missing or inaccessible.
46
+
47
+ ## Release Workflow
48
+
49
+ Before release:
50
+
51
+ - Confirm tests and build pass.
52
+ - Confirm docs match behavior.
53
+ - Confirm environment variables and migrations are documented.
54
+ - Confirm no secrets or local-only files are included.