From f11c306ac69b3cdc0c6fefc7cec4c7e69e38035b Mon Sep 17 00:00:00 2001 From: NHoarau Date: Thu, 4 Jun 2026 16:33:06 +0400 Subject: [PATCH] feat: add type checking and linting improvements across the project - Added "check-types" script to package.json for type checking in both api and web apps. - Updated ESLint configuration to use a shared tooling package for consistent linting rules. - Refactored TypeScript configurations to extend from shared tooling configurations. - Improved code formatting and consistency in various files, including Vue components and TypeScript files. - Introduced CI workflow for automated linting, formatting checks, and type checking on push and pull request events. - Cleaned up unnecessary dependencies and updated existing ones for better performance and maintainability. --- .forgejo/workflows/ci.yml | 40 +++++++ .opencode/commands/opsx-apply.md | 3 + .opencode/commands/opsx-archive.md | 2 + .opencode/commands/opsx-explore.md | 24 ++-- .opencode/commands/opsx-propose.md | 48 ++++---- .opencode/commands/opsx-sync.md | 43 ++++--- .../skills/openspec-apply-change/SKILL.md | 3 + .../skills/openspec-archive-change/SKILL.md | 2 + .opencode/skills/openspec-explore/SKILL.md | 27 +++-- .opencode/skills/openspec-propose/SKILL.md | 48 ++++---- .opencode/skills/openspec-sync-specs/SKILL.md | 43 ++++--- .prettierignore | 7 ++ .prettierrc.mjs | 4 + .vscode/settings.json | 3 + AGENTS.md | 6 +- apps/api/.prettierrc | 4 - apps/api/eslint.config.mjs | 36 +----- apps/api/package.json | 10 +- apps/api/test/app.e2e-spec.ts | 5 +- apps/api/tsconfig.json | 21 +--- apps/web/app/app.config.ts | 10 +- apps/web/app/app.vue | 20 ++-- apps/web/app/components/TemplateMenu.vue | 18 +-- apps/web/app/pages/index.vue | 20 ++-- apps/web/eslint.config.mjs | 11 +- apps/web/nuxt.config.ts | 25 ++-- apps/web/package.json | 4 +- package.json | 2 + packages/schema/eslint.config.mjs | 23 ++++ packages/schema/package.json | 6 +- packages/schema/src/drizzle/enums.ts | 7 +- packages/schema/src/drizzle/projects.ts | 15 +-- packages/schema/src/drizzle/tasks.ts | 27 +---- packages/schema/src/index.ts | 9 +- packages/schema/src/valibot.ts | 14 +-- packages/schema/tsconfig.json | 16 +-- packages/tooling/eslint/base.mjs | 55 +++++++++ packages/tooling/eslint/nestjs.mjs | 42 +++++++ packages/tooling/package.json | 27 +++++ packages/tooling/prettier/index.mjs | 12 ++ packages/tooling/tsconfig/base.json | 12 ++ packages/tooling/tsconfig/library.json | 11 ++ packages/tooling/tsconfig/nestjs.json | 16 +++ pnpm-lock.yaml | 111 ++++++++++++------ 44 files changed, 566 insertions(+), 326 deletions(-) create mode 100644 .forgejo/workflows/ci.yml create mode 100644 .prettierignore create mode 100644 .prettierrc.mjs create mode 100644 .vscode/settings.json delete mode 100644 apps/api/.prettierrc create mode 100644 packages/schema/eslint.config.mjs create mode 100644 packages/tooling/eslint/base.mjs create mode 100644 packages/tooling/eslint/nestjs.mjs create mode 100644 packages/tooling/package.json create mode 100644 packages/tooling/prettier/index.mjs create mode 100644 packages/tooling/tsconfig/base.json create mode 100644 packages/tooling/tsconfig/library.json create mode 100644 packages/tooling/tsconfig/nestjs.json diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml new file mode 100644 index 0000000..99e936d --- /dev/null +++ b/.forgejo/workflows/ci.yml @@ -0,0 +1,40 @@ +name: ci + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + ci: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [22] + + steps: + - name: Checkout + uses: actions/checkout@v6 + + - name: Install pnpm + uses: pnpm/action-setup@v6 + + - name: Install Node.js + uses: actions/setup-node@v6 + with: + node-version: ${{ matrix.node-version }} + cache: pnpm + + - name: Install dependencies + run: pnpm install + + - name: Format check + run: pnpm format:check + + - name: Lint + run: pnpm lint + + - name: Typecheck + run: pnpm check-types diff --git a/.opencode/commands/opsx-apply.md b/.opencode/commands/opsx-apply.md index 9d0f3fc..cb2f0a6 100644 --- a/.opencode/commands/opsx-apply.md +++ b/.opencode/commands/opsx-apply.md @@ -18,9 +18,11 @@ Implement tasks from an OpenSpec change. Always announce: "Using change: " and how to override (e.g., `/opsx-apply `). 2. **Check status to understand the schema** + ```bash openspec status --change "" --json ``` + Parse the JSON to understand: - `schemaName`: The workflow being used (e.g., "spec-driven") - `planningHome`, `changeRoot`, and `actionContext`: planning scope and edit constraints @@ -135,6 +137,7 @@ What would you like to do? ``` **Guardrails** + - Keep going through tasks until done or blocked - Always read context files before starting (from the apply instructions output) - If task is ambiguous, pause and ask before implementing diff --git a/.opencode/commands/opsx-archive.md b/.opencode/commands/opsx-archive.md index 8f4e144..a480b03 100644 --- a/.opencode/commands/opsx-archive.md +++ b/.opencode/commands/opsx-archive.md @@ -64,6 +64,7 @@ Archive a completed change in the experimental workflow. 5. **Perform the archive** Create an `archive` directory under `planningHome.changesDir` if it doesn't exist: + ```bash mkdir -p "/archive" ``` @@ -148,6 +149,7 @@ Target archive directory already exists. ``` **Guardrails** + - Always prompt for change selection if not provided - Use artifact graph (openspec status --json) for completion checking - Don't block archive on warnings - just inform and confirm diff --git a/.opencode/commands/opsx-explore.md b/.opencode/commands/opsx-explore.md index a4ed088..712c678 100644 --- a/.opencode/commands/opsx-explore.md +++ b/.opencode/commands/opsx-explore.md @@ -9,6 +9,7 @@ Enter explore mode. Think deeply. Visualize freely. Follow the conversation wher **This is a stance, not a workflow.** There are no fixed steps, no required sequence, no mandatory outputs. You're a thinking partner helping the user explore. **Input**: The argument after `/opsx-explore` is whatever the user wants to think about. Could be: + - A vague idea: "real-time collaboration" - A specific problem: "the auth system is getting unwieldy" - A change name: "add-dark-mode" (to explore in context of that change) @@ -33,24 +34,28 @@ Enter explore mode. Think deeply. Visualize freely. Follow the conversation wher Depending on what the user brings, you might: **Explore the problem space** + - Ask clarifying questions that emerge from what they said - Challenge assumptions - Reframe the problem - Find analogies **Investigate the codebase** + - Map existing architecture relevant to the discussion - Find integration points - Identify patterns already in use - Surface hidden complexity **Compare options** + - Brainstorm multiple approaches - Build comparison tables - Sketch tradeoffs - Recommend a path (if asked) **Visualize** + ``` ┌─────────────────────────────────────────┐ │ Use ASCII diagrams liberally │ @@ -69,6 +74,7 @@ Depending on what the user brings, you might: ``` **Surface risks and unknowns** + - Identify what could go wrong - Find gaps in understanding - Suggest spikes or investigations @@ -82,11 +88,13 @@ You have full context of the OpenSpec system. Use it naturally, don't force it. ### Check for context At the start, quickly check what exists: + ```bash openspec list --json ``` This tells you: + - If there are active changes - Their names, schemas, and status - What the user might be working on @@ -115,14 +123,14 @@ If the user mentions a change or you detect one is relevant: 3. **Offer to capture when decisions are made** - | Insight Type | Where to Capture | - |----------------------------|--------------------------------| - | New requirement discovered | `specs//spec.md` | - | Requirement changed | `specs//spec.md` | - | Design decision made | `design.md` | - | Scope changed | `proposal.md` | - | New work identified | `tasks.md` | - | Assumption invalidated | Relevant artifact | + | Insight Type | Where to Capture | + | -------------------------- | ---------------------------- | + | New requirement discovered | `specs//spec.md` | + | Requirement changed | `specs//spec.md` | + | Design decision made | `design.md` | + | Scope changed | `proposal.md` | + | New work identified | `tasks.md` | + | Assumption invalidated | Relevant artifact | Example offers: - "That's a design decision. Capture it in design.md?" diff --git a/.opencode/commands/opsx-propose.md b/.opencode/commands/opsx-propose.md index f100115..937037f 100644 --- a/.opencode/commands/opsx-propose.md +++ b/.opencode/commands/opsx-propose.md @@ -5,6 +5,7 @@ description: Propose a new change - create it and generate all artifacts in one Propose a new change - create the change and generate all artifacts in one step. I'll create a change with artifacts: + - proposal.md (what & why) - design.md (how) - tasks.md (implementation steps) @@ -20,6 +21,7 @@ When ready to implement, run /opsx-apply 1. **If no input provided, ask what they want to build** Use the **AskUserQuestion tool** (open-ended, no preset options) to ask: + > "What change do you want to work on? Describe what you want to build or fix." From their description, derive a kebab-case name (e.g., "add user authentication" → `add-user-auth`). @@ -27,15 +29,19 @@ When ready to implement, run /opsx-apply **IMPORTANT**: Do NOT proceed without understanding what the user wants to build. 2. **Create the change directory** + ```bash openspec new change "" ``` + This creates a scaffolded change in the planning home resolved by the CLI with `.openspec.yaml`. 3. **Get the artifact build order** + ```bash openspec status --change "" --json ``` + Parse the JSON to get: - `applyRequires`: array of artifact IDs needed before implementation (e.g., `["tasks"]`) - `artifacts`: list of all artifacts with their status and dependencies @@ -48,30 +54,30 @@ When ready to implement, run /opsx-apply Loop through artifacts in dependency order (artifacts with no pending dependencies first): a. **For each artifact that is `ready` (dependencies satisfied)**: - - Get instructions: - ```bash - openspec instructions --change "" --json - ``` - - The instructions JSON includes: - - `context`: Project background (constraints for you - do NOT include in output) - - `rules`: Artifact-specific rules (constraints for you - do NOT include in output) - - `template`: The structure to use for your output file - - `instruction`: Schema-specific guidance for this artifact type - - `resolvedOutputPath`: Resolved path or pattern to write the artifact - - `dependencies`: Completed artifacts to read for context - - Read any completed dependency files for context - - Create the artifact file using `template` as the structure and write it to `resolvedOutputPath` - - Apply `context` and `rules` as constraints - but do NOT copy them into the file - - Show brief progress: "Created " + - Get instructions: + ```bash + openspec instructions --change "" --json + ``` + - The instructions JSON includes: + - `context`: Project background (constraints for you - do NOT include in output) + - `rules`: Artifact-specific rules (constraints for you - do NOT include in output) + - `template`: The structure to use for your output file + - `instruction`: Schema-specific guidance for this artifact type + - `resolvedOutputPath`: Resolved path or pattern to write the artifact + - `dependencies`: Completed artifacts to read for context + - Read any completed dependency files for context + - Create the artifact file using `template` as the structure and write it to `resolvedOutputPath` + - Apply `context` and `rules` as constraints - but do NOT copy them into the file + - Show brief progress: "Created " b. **Continue until all `applyRequires` artifacts are complete** - - After creating each artifact, re-run `openspec status --change "" --json` - - Check if every artifact ID in `applyRequires` has `status: "done"` in the artifacts array - - Stop when all `applyRequires` artifacts are done + - After creating each artifact, re-run `openspec status --change "" --json` + - Check if every artifact ID in `applyRequires` has `status: "done"` in the artifacts array + - Stop when all `applyRequires` artifacts are done c. **If an artifact requires user input** (unclear context): - - Use **AskUserQuestion tool** to clarify - - Then continue with creation + - Use **AskUserQuestion tool** to clarify + - Then continue with creation 5. **Show final status** ```bash @@ -81,6 +87,7 @@ When ready to implement, run /opsx-apply **Output** After completing all artifacts, summarize: + - Change name and location - List of artifacts created with brief descriptions - What's ready: "All artifacts created! Ready for implementation." @@ -97,6 +104,7 @@ After completing all artifacts, summarize: - These guide what you write, but should never appear in the output **Guardrails** + - Create ALL artifacts needed for implementation (as defined by schema's `apply.requires`) - Always read dependency artifacts before creating a new one - If context is critically unclear, ask the user - but prefer making reasonable decisions to keep momentum diff --git a/.opencode/commands/opsx-sync.md b/.opencode/commands/opsx-sync.md index bbde982..12ca7c3 100644 --- a/.opencode/commands/opsx-sync.md +++ b/.opencode/commands/opsx-sync.md @@ -21,6 +21,7 @@ This is an **agent-driven** operation - you will read delta specs and directly e 2. **Resolve change context** Run: + ```bash openspec status --change "" --json ``` @@ -49,28 +50,28 @@ This is an **agent-driven** operation - you will read delta specs and directly e c. **Apply changes intelligently**: - **ADDED Requirements:** - - If requirement doesn't exist in main spec → add it - - If requirement already exists → update it to match (treat as implicit MODIFIED) + **ADDED Requirements:** + - If requirement doesn't exist in main spec → add it + - If requirement already exists → update it to match (treat as implicit MODIFIED) - **MODIFIED Requirements:** - - Find the requirement in main spec - - Apply the changes - this can be: - - Adding new scenarios (don't need to copy existing ones) - - Modifying existing scenarios - - Changing the requirement description - - Preserve scenarios/content not mentioned in the delta + **MODIFIED Requirements:** + - Find the requirement in main spec + - Apply the changes - this can be: + - Adding new scenarios (don't need to copy existing ones) + - Modifying existing scenarios + - Changing the requirement description + - Preserve scenarios/content not mentioned in the delta - **REMOVED Requirements:** - - Remove the entire requirement block from main spec + **REMOVED Requirements:** + - Remove the entire requirement block from main spec - **RENAMED Requirements:** - - Find the FROM requirement, rename to TO + **RENAMED Requirements:** + - Find the FROM requirement, rename to TO d. **Create new main spec** if capability doesn't exist yet: - - Create `openspec/specs//spec.md` - - Add Purpose section (can be brief, mark as TBD) - - Add Requirements section with the ADDED requirements + - Create `openspec/specs//spec.md` + - Add Purpose section (can be brief, mark as TBD) + - Add Requirements section with the ADDED requirements 5. **Show summary** @@ -84,16 +85,20 @@ This is an **agent-driven** operation - you will read delta specs and directly e ## ADDED Requirements ### Requirement: New Feature + The system SHALL do something new. #### Scenario: Basic case + - **WHEN** user does X - **THEN** system does Y ## MODIFIED Requirements ### Requirement: Existing Feature + #### Scenario: New scenario to add + - **WHEN** user does A - **THEN** system does B @@ -110,8 +115,9 @@ The system SHALL do something new. **Key Principle: Intelligent Merging** Unlike programmatic merging, you can apply **partial updates**: + - To add a scenario, just include that scenario under MODIFIED - don't copy existing scenarios -- The delta represents *intent*, not a wholesale replacement +- The delta represents _intent_, not a wholesale replacement - Use your judgment to merge changes sensibly **Output On Success** @@ -133,6 +139,7 @@ Main specs are now updated. The change remains active - archive when implementat ``` **Guardrails** + - Read both delta and main specs before making changes - Preserve existing content not mentioned in delta - If something is unclear, ask for clarification diff --git a/.opencode/skills/openspec-apply-change/SKILL.md b/.opencode/skills/openspec-apply-change/SKILL.md index 7bfb6c5..fa790e1 100644 --- a/.opencode/skills/openspec-apply-change/SKILL.md +++ b/.opencode/skills/openspec-apply-change/SKILL.md @@ -25,9 +25,11 @@ Implement tasks from an OpenSpec change. Always announce: "Using change: " and how to override (e.g., `/opsx-apply `). 2. **Check status to understand the schema** + ```bash openspec status --change "" --json ``` + Parse the JSON to understand: - `schemaName`: The workflow being used (e.g., "spec-driven") - `planningHome`, `changeRoot`, and `actionContext`: planning scope and edit constraints @@ -142,6 +144,7 @@ What would you like to do? ``` **Guardrails** + - Keep going through tasks until done or blocked - Always read context files before starting (from the apply instructions output) - If task is ambiguous, pause and ask before implementing diff --git a/.opencode/skills/openspec-archive-change/SKILL.md b/.opencode/skills/openspec-archive-change/SKILL.md index 97c3e5e..463c72b 100644 --- a/.opencode/skills/openspec-archive-change/SKILL.md +++ b/.opencode/skills/openspec-archive-change/SKILL.md @@ -71,6 +71,7 @@ Archive a completed change in the experimental workflow. 5. **Perform the archive** Create an `archive` directory under `planningHome.changesDir` if it doesn't exist: + ```bash mkdir -p "/archive" ``` @@ -108,6 +109,7 @@ All artifacts complete. All tasks complete. ``` **Guardrails** + - Always prompt for change selection if not provided - Use artifact graph (openspec status --json) for completion checking - Don't block archive on warnings - just inform and confirm diff --git a/.opencode/skills/openspec-explore/SKILL.md b/.opencode/skills/openspec-explore/SKILL.md index a841906..858fbd2 100644 --- a/.opencode/skills/openspec-explore/SKILL.md +++ b/.opencode/skills/openspec-explore/SKILL.md @@ -33,24 +33,28 @@ Enter explore mode. Think deeply. Visualize freely. Follow the conversation wher Depending on what the user brings, you might: **Explore the problem space** + - Ask clarifying questions that emerge from what they said - Challenge assumptions - Reframe the problem - Find analogies **Investigate the codebase** + - Map existing architecture relevant to the discussion - Find integration points - Identify patterns already in use - Surface hidden complexity **Compare options** + - Brainstorm multiple approaches - Build comparison tables - Sketch tradeoffs - Recommend a path (if asked) **Visualize** + ``` ┌─────────────────────────────────────────┐ │ Use ASCII diagrams liberally │ @@ -69,6 +73,7 @@ Depending on what the user brings, you might: ``` **Surface risks and unknowns** + - Identify what could go wrong - Find gaps in understanding - Suggest spikes or investigations @@ -82,11 +87,13 @@ You have full context of the OpenSpec system. Use it naturally, don't force it. ### Check for context At the start, quickly check what exists: + ```bash openspec list --json ``` This tells you: + - If there are active changes - Their names, schemas, and status - What the user might be working on @@ -113,14 +120,14 @@ If the user mentions a change or you detect one is relevant: 3. **Offer to capture when decisions are made** - | Insight Type | Where to Capture | - |----------------------------|--------------------------------| - | New requirement discovered | `specs//spec.md` | - | Requirement changed | `specs//spec.md` | - | Design decision made | `design.md` | - | Scope changed | `proposal.md` | - | New work identified | `tasks.md` | - | Assumption invalidated | Relevant artifact | + | Insight Type | Where to Capture | + | -------------------------- | ---------------------------- | + | New requirement discovered | `specs//spec.md` | + | Requirement changed | `specs//spec.md` | + | Design decision made | `design.md` | + | Scope changed | `proposal.md` | + | New work identified | `tasks.md` | + | Assumption invalidated | Relevant artifact | Example offers: - "That's a design decision. Capture it in design.md?" @@ -145,6 +152,7 @@ If the user mentions a change or you detect one is relevant: ## Handling Different Entry Points **User brings a vague idea:** + ``` User: I'm thinking about adding real-time collaboration @@ -168,6 +176,7 @@ You: Real-time collab is a big space. Let me think about this... ``` **User brings a specific problem:** + ``` User: The auth system is a mess @@ -199,6 +208,7 @@ You: [reads codebase] ``` **User is stuck mid-implementation:** + ``` User: /opsx-explore add-auth-system The OAuth integration is more complex than expected @@ -216,6 +226,7 @@ You: [reads change artifacts] ``` **User wants to compare options:** + ``` User: Should we use Postgres or SQLite? diff --git a/.opencode/skills/openspec-propose/SKILL.md b/.opencode/skills/openspec-propose/SKILL.md index 83b5557..45edf6e 100644 --- a/.opencode/skills/openspec-propose/SKILL.md +++ b/.opencode/skills/openspec-propose/SKILL.md @@ -12,6 +12,7 @@ metadata: Propose a new change - create the change and generate all artifacts in one step. I'll create a change with artifacts: + - proposal.md (what & why) - design.md (how) - tasks.md (implementation steps) @@ -27,6 +28,7 @@ When ready to implement, run /opsx-apply 1. **If no clear input provided, ask what they want to build** Use the **AskUserQuestion tool** (open-ended, no preset options) to ask: + > "What change do you want to work on? Describe what you want to build or fix." From their description, derive a kebab-case name (e.g., "add user authentication" → `add-user-auth`). @@ -34,15 +36,19 @@ When ready to implement, run /opsx-apply **IMPORTANT**: Do NOT proceed without understanding what the user wants to build. 2. **Create the change directory** + ```bash openspec new change "" ``` + This creates a scaffolded change in the planning home resolved by the CLI with `.openspec.yaml`. 3. **Get the artifact build order** + ```bash openspec status --change "" --json ``` + Parse the JSON to get: - `applyRequires`: array of artifact IDs needed before implementation (e.g., `["tasks"]`) - `artifacts`: list of all artifacts with their status and dependencies @@ -55,30 +61,30 @@ When ready to implement, run /opsx-apply Loop through artifacts in dependency order (artifacts with no pending dependencies first): a. **For each artifact that is `ready` (dependencies satisfied)**: - - Get instructions: - ```bash - openspec instructions --change "" --json - ``` - - The instructions JSON includes: - - `context`: Project background (constraints for you - do NOT include in output) - - `rules`: Artifact-specific rules (constraints for you - do NOT include in output) - - `template`: The structure to use for your output file - - `instruction`: Schema-specific guidance for this artifact type - - `resolvedOutputPath`: Resolved path or pattern to write the artifact - - `dependencies`: Completed artifacts to read for context - - Read any completed dependency files for context - - Create the artifact file using `template` as the structure and write it to `resolvedOutputPath` - - Apply `context` and `rules` as constraints - but do NOT copy them into the file - - Show brief progress: "Created " + - Get instructions: + ```bash + openspec instructions --change "" --json + ``` + - The instructions JSON includes: + - `context`: Project background (constraints for you - do NOT include in output) + - `rules`: Artifact-specific rules (constraints for you - do NOT include in output) + - `template`: The structure to use for your output file + - `instruction`: Schema-specific guidance for this artifact type + - `resolvedOutputPath`: Resolved path or pattern to write the artifact + - `dependencies`: Completed artifacts to read for context + - Read any completed dependency files for context + - Create the artifact file using `template` as the structure and write it to `resolvedOutputPath` + - Apply `context` and `rules` as constraints - but do NOT copy them into the file + - Show brief progress: "Created " b. **Continue until all `applyRequires` artifacts are complete** - - After creating each artifact, re-run `openspec status --change "" --json` - - Check if every artifact ID in `applyRequires` has `status: "done"` in the artifacts array - - Stop when all `applyRequires` artifacts are done + - After creating each artifact, re-run `openspec status --change "" --json` + - Check if every artifact ID in `applyRequires` has `status: "done"` in the artifacts array + - Stop when all `applyRequires` artifacts are done c. **If an artifact requires user input** (unclear context): - - Use **AskUserQuestion tool** to clarify - - Then continue with creation + - Use **AskUserQuestion tool** to clarify + - Then continue with creation 5. **Show final status** ```bash @@ -88,6 +94,7 @@ When ready to implement, run /opsx-apply **Output** After completing all artifacts, summarize: + - Change name and location - List of artifacts created with brief descriptions - What's ready: "All artifacts created! Ready for implementation." @@ -104,6 +111,7 @@ After completing all artifacts, summarize: - These guide what you write, but should never appear in the output **Guardrails** + - Create ALL artifacts needed for implementation (as defined by schema's `apply.requires`) - Always read dependency artifacts before creating a new one - If context is critically unclear, ask the user - but prefer making reasonable decisions to keep momentum diff --git a/.opencode/skills/openspec-sync-specs/SKILL.md b/.opencode/skills/openspec-sync-specs/SKILL.md index e29bdd9..ac4a813 100644 --- a/.opencode/skills/openspec-sync-specs/SKILL.md +++ b/.opencode/skills/openspec-sync-specs/SKILL.md @@ -28,6 +28,7 @@ This is an **agent-driven** operation - you will read delta specs and directly e 2. **Resolve change context** Run: + ```bash openspec status --change "" --json ``` @@ -56,28 +57,28 @@ This is an **agent-driven** operation - you will read delta specs and directly e c. **Apply changes intelligently**: - **ADDED Requirements:** - - If requirement doesn't exist in main spec → add it - - If requirement already exists → update it to match (treat as implicit MODIFIED) + **ADDED Requirements:** + - If requirement doesn't exist in main spec → add it + - If requirement already exists → update it to match (treat as implicit MODIFIED) - **MODIFIED Requirements:** - - Find the requirement in main spec - - Apply the changes - this can be: - - Adding new scenarios (don't need to copy existing ones) - - Modifying existing scenarios - - Changing the requirement description - - Preserve scenarios/content not mentioned in the delta + **MODIFIED Requirements:** + - Find the requirement in main spec + - Apply the changes - this can be: + - Adding new scenarios (don't need to copy existing ones) + - Modifying existing scenarios + - Changing the requirement description + - Preserve scenarios/content not mentioned in the delta - **REMOVED Requirements:** - - Remove the entire requirement block from main spec + **REMOVED Requirements:** + - Remove the entire requirement block from main spec - **RENAMED Requirements:** - - Find the FROM requirement, rename to TO + **RENAMED Requirements:** + - Find the FROM requirement, rename to TO d. **Create new main spec** if capability doesn't exist yet: - - Create `openspec/specs//spec.md` - - Add Purpose section (can be brief, mark as TBD) - - Add Requirements section with the ADDED requirements + - Create `openspec/specs//spec.md` + - Add Purpose section (can be brief, mark as TBD) + - Add Requirements section with the ADDED requirements 5. **Show summary** @@ -91,16 +92,20 @@ This is an **agent-driven** operation - you will read delta specs and directly e ## ADDED Requirements ### Requirement: New Feature + The system SHALL do something new. #### Scenario: Basic case + - **WHEN** user does X - **THEN** system does Y ## MODIFIED Requirements ### Requirement: Existing Feature + #### Scenario: New scenario to add + - **WHEN** user does A - **THEN** system does B @@ -117,8 +122,9 @@ The system SHALL do something new. **Key Principle: Intelligent Merging** Unlike programmatic merging, you can apply **partial updates**: + - To add a scenario, just include that scenario under MODIFIED - don't copy existing scenarios -- The delta represents *intent*, not a wholesale replacement +- The delta represents _intent_, not a wholesale replacement - Use your judgment to merge changes sensibly **Output On Success** @@ -140,6 +146,7 @@ Main specs are now updated. The change remains active - archive when implementat ``` **Guardrails** + - Read both delta and main specs before making changes - Preserve existing content not mentioned in delta - If something is unclear, ask for clarification diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..0eb076f --- /dev/null +++ b/.prettierignore @@ -0,0 +1,7 @@ +node_modules +.turbo +dist +.nuxt +.output +coverage +pnpm-lock.yaml diff --git a/.prettierrc.mjs b/.prettierrc.mjs new file mode 100644 index 0000000..b4081c1 --- /dev/null +++ b/.prettierrc.mjs @@ -0,0 +1,4 @@ +// @ts-check +import config from "@workspace/tooling/prettier"; + +export default config; diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..25fa621 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "typescript.tsdk": "node_modules/typescript/lib" +} diff --git a/AGENTS.md b/AGENTS.md index 5bf2dbc..9831100 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -80,9 +80,9 @@ All commands run from the repository root. - **ESLint flat config** (`eslint.config.mjs`) in each app. - API uses `@typescript-eslint` with `recommendedTypeChecked` rules, plus `eslint-plugin-prettier`. - Key relaxed rules: - - `@typescript-eslint/no-explicit-any: off` - - `@typescript-eslint/no-floating-promises: warn` - - `@typescript-eslint/no-unsafe-argument: warn` + - `@typescript-eslint/no-explicit-any: off` + - `@typescript-eslint/no-floating-promises: warn` + - `@typescript-eslint/no-unsafe-argument: warn` - Web uses `@nuxt/eslint` with stylistic config (`commaDangle: never`, `braceStyle: 1tbs`). ### TypeScript diff --git a/apps/api/.prettierrc b/apps/api/.prettierrc deleted file mode 100644 index f3bcd4c..0000000 --- a/apps/api/.prettierrc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "singleQuote": false, - "trailingComma": "all" -} diff --git a/apps/api/eslint.config.mjs b/apps/api/eslint.config.mjs index 4e9f827..bb2c064 100644 --- a/apps/api/eslint.config.mjs +++ b/apps/api/eslint.config.mjs @@ -1,35 +1,3 @@ -// @ts-check -import eslint from '@eslint/js'; -import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended'; -import globals from 'globals'; -import tseslint from 'typescript-eslint'; +import { createNestjsConfig } from "@workspace/tooling/eslint/nestjs"; -export default tseslint.config( - { - ignores: ['eslint.config.mjs'], - }, - eslint.configs.recommended, - ...tseslint.configs.recommendedTypeChecked, - eslintPluginPrettierRecommended, - { - languageOptions: { - globals: { - ...globals.node, - ...globals.jest, - }, - sourceType: 'commonjs', - parserOptions: { - projectService: true, - tsconfigRootDir: import.meta.dirname, - }, - }, - }, - { - rules: { - '@typescript-eslint/no-explicit-any': 'off', - '@typescript-eslint/no-floating-promises': 'warn', - '@typescript-eslint/no-unsafe-argument': 'warn', - "prettier/prettier": ["error", { endOfLine: "auto" }], - }, - }, -); +export default createNestjsConfig(import.meta.dirname); diff --git a/apps/api/package.json b/apps/api/package.json index d39c14a..76b7885 100644 --- a/apps/api/package.json +++ b/apps/api/package.json @@ -13,6 +13,7 @@ "dev": "nest start --watch", "start:debug": "nest start --debug --watch", "start:prod": "node dist/main", + "check-types": "tsc --noEmit", "lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix", "test": "jest", "test:watch": "jest --watch", @@ -29,8 +30,6 @@ "rxjs": "^7.8.1" }, "devDependencies": { - "@eslint/eslintrc": "^3.2.0", - "@eslint/js": "^9.18.0", "@nestjs/cli": "^11.0.0", "@nestjs/schematics": "^11.0.0", "@nestjs/testing": "^11.0.1", @@ -38,10 +37,8 @@ "@types/jest": "^30.0.0", "@types/node": "^22.10.7", "@types/supertest": "^6.0.2", + "@workspace/tooling": "workspace:*", "eslint": "^9.18.0", - "eslint-config-prettier": "^10.0.1", - "eslint-plugin-prettier": "^5.2.2", - "globals": "^16.0.0", "jest": "^30.0.0", "prettier": "^3.4.2", "source-map-support": "^0.5.21", @@ -50,8 +47,7 @@ "ts-loader": "^9.5.2", "ts-node": "^10.9.2", "tsconfig-paths": "^4.2.0", - "typescript": "^5.7.3", - "typescript-eslint": "^8.20.0" + "typescript": "^5.7.3" }, "jest": { "moduleFileExtensions": [ diff --git a/apps/api/test/app.e2e-spec.ts b/apps/api/test/app.e2e-spec.ts index 76ccc7c..fa8410c 100644 --- a/apps/api/test/app.e2e-spec.ts +++ b/apps/api/test/app.e2e-spec.ts @@ -17,9 +17,6 @@ describe("AppController (e2e)", () => { }); it("/ (GET)", () => { - return request(app.getHttpServer()) - .get("/") - .expect(200) - .expect("Hello World!"); + return request(app.getHttpServer()).get("/").expect(200).expect("Hello World!"); }); }); diff --git a/apps/api/tsconfig.json b/apps/api/tsconfig.json index aba29b0..1cf4296 100644 --- a/apps/api/tsconfig.json +++ b/apps/api/tsconfig.json @@ -1,25 +1,8 @@ { + "extends": "@workspace/tooling/tsconfig/nestjs.json", "compilerOptions": { - "module": "nodenext", - "moduleResolution": "nodenext", - "resolvePackageJsonExports": true, - "esModuleInterop": true, - "isolatedModules": true, - "declaration": true, - "removeComments": true, - "emitDecoratorMetadata": true, - "experimentalDecorators": true, - "allowSyntheticDefaultImports": true, - "target": "ES2023", - "sourceMap": true, "outDir": "./dist", "baseUrl": "./", - "incremental": true, - "skipLibCheck": true, - "strictNullChecks": true, - "forceConsistentCasingInFileNames": true, - "noImplicitAny": false, - "strictBindCallApply": false, - "noFallthroughCasesInSwitch": false + "incremental": true } } diff --git a/apps/web/app/app.config.ts b/apps/web/app/app.config.ts index 9f027bf..7420448 100644 --- a/apps/web/app/app.config.ts +++ b/apps/web/app/app.config.ts @@ -1,8 +1,8 @@ export default defineAppConfig({ ui: { colors: { - primary: 'green', - neutral: 'slate' - } - } -}) + primary: "green", + neutral: "slate", + }, + }, +}); diff --git a/apps/web/app/app.vue b/apps/web/app/app.vue index 06840ca..534b6be 100644 --- a/apps/web/app/app.vue +++ b/apps/web/app/app.vue @@ -1,27 +1,27 @@