@thiagodiogo/pscode 1.0.1 → 2.0.1
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/LICENSE +22 -22
- package/README.md +142 -142
- package/bin/pscode.js +4 -4
- package/dist/cli/index.js +0 -1
- package/dist/commands/feedback.js +4 -4
- package/dist/commands/schema.js +60 -60
- package/dist/core/collections/initiatives/templates.js +57 -57
- package/dist/core/command-generation/adapters/claude.js +8 -8
- package/dist/core/command-generation/adapters/codex.js +6 -6
- package/dist/core/command-generation/adapters/cursor.js +8 -8
- package/dist/core/command-generation/adapters/gemini.js +5 -5
- package/dist/core/command-generation/adapters/github-copilot.js +5 -5
- package/dist/core/complete.d.ts +0 -1
- package/dist/core/complete.js +35 -59
- package/dist/core/completions/command-registry.js +0 -4
- package/dist/core/completions/generators/bash-generator.js +41 -41
- package/dist/core/completions/generators/fish-generator.js +7 -7
- package/dist/core/completions/generators/powershell-generator.js +29 -29
- package/dist/core/completions/generators/zsh-generator.js +33 -33
- package/dist/core/completions/templates/bash-templates.js +24 -24
- package/dist/core/completions/templates/fish-templates.js +38 -38
- package/dist/core/completions/templates/powershell-templates.js +28 -28
- package/dist/core/completions/templates/zsh-templates.js +39 -39
- package/dist/core/init.js +0 -1
- package/dist/core/profile-sync-drift.js +0 -1
- package/dist/core/profiles.d.ts +3 -3
- package/dist/core/profiles.js +2 -3
- package/dist/core/shared/skill-generation.js +1 -3
- package/dist/core/shared/tool-detection.d.ts +2 -2
- package/dist/core/shared/tool-detection.js +0 -2
- package/dist/core/templates/skill-templates.d.ts +0 -1
- package/dist/core/templates/skill-templates.js +0 -1
- package/dist/core/templates/workflows/apply-change.js +264 -264
- package/dist/core/templates/workflows/archive-change.js +204 -204
- package/dist/core/templates/workflows/bulk-archive-change.js +472 -472
- package/dist/core/templates/workflows/continue-change.js +214 -214
- package/dist/core/templates/workflows/explore.js +735 -735
- package/dist/core/templates/workflows/feedback.js +97 -97
- package/dist/core/templates/workflows/ff-change.js +180 -180
- package/dist/core/templates/workflows/new-change.js +123 -123
- package/dist/core/templates/workflows/onboard.js +584 -584
- package/dist/core/templates/workflows/propose.js +324 -324
- package/dist/core/templates/workflows/trello-draft.js +194 -194
- package/dist/core/templates/workflows/trello-setup.js +292 -292
- package/dist/core/templates/workflows/verify-change.js +318 -318
- package/dist/core/workspace/open-surface.js +30 -30
- package/package.json +18 -20
- package/schemas/spec-driven/schema.yaml +153 -153
- package/schemas/spec-driven/templates/design.md +19 -19
- package/schemas/spec-driven/templates/proposal.md +23 -23
- package/schemas/spec-driven/templates/spec.md +8 -8
- package/schemas/spec-driven/templates/tasks.md +9 -9
- package/schemas/workspace-planning/schema.yaml +72 -72
- package/schemas/workspace-planning/templates/design.md +33 -33
- package/schemas/workspace-planning/templates/proposal.md +28 -28
- package/schemas/workspace-planning/templates/spec.md +9 -9
- package/schemas/workspace-planning/templates/tasks.md +15 -15
- package/scripts/postinstall.js +83 -83
- package/dist/core/templates/workflows/sync-specs.d.ts +0 -10
- package/dist/core/templates/workflows/sync-specs.js +0 -290
|
@@ -1,72 +1,72 @@
|
|
|
1
|
-
name: workspace-planning
|
|
2
|
-
version: 1
|
|
3
|
-
description: Workspace planning workflow for cross-area changes
|
|
4
|
-
artifacts:
|
|
5
|
-
- id: proposal
|
|
6
|
-
generates: proposal.md
|
|
7
|
-
description: Shared workspace proposal with the product goal, scope, affected areas, and impact
|
|
8
|
-
template: proposal.md
|
|
9
|
-
instruction: |
|
|
10
|
-
Create the workspace-level proposal that captures the shared product goal once.
|
|
11
|
-
|
|
12
|
-
Sections:
|
|
13
|
-
- **Why**: Explain the product goal or problem in 1-2 concise paragraphs.
|
|
14
|
-
- **What Changes**: List the cross-area behavior, workflow, or capability changes.
|
|
15
|
-
- **Affected Areas**: Name known affected areas using registered workspace link names where applicable. If scope is still being explored, say what remains unresolved.
|
|
16
|
-
- **Capabilities**: Identify workspace-scoped capabilities that need specs. Area-specific requirements should later live under `specs/<area-or-repo>/<capability>/spec.md`.
|
|
17
|
-
- **Impact**: Summarize user-facing impact, planning impact, and likely implementation homes without creating repo-local artifacts.
|
|
18
|
-
|
|
19
|
-
Keep linked repos and folders as exploration context until an explicit implementation workflow selects an affected area.
|
|
20
|
-
requires: []
|
|
21
|
-
|
|
22
|
-
- id: specs
|
|
23
|
-
generates: "specs/**/*.md"
|
|
24
|
-
description: Workspace-scoped specs organized by affected area and capability
|
|
25
|
-
template: spec.md
|
|
26
|
-
instruction: |
|
|
27
|
-
Create workspace-scoped specification files that define WHAT should change.
|
|
28
|
-
|
|
29
|
-
Use `specs/<area-or-repo>/<capability>/spec.md` for area-specific requirements. The first path segment should be a registered workspace link name when a registered area owns the requirement. If the area is unresolved, use an exploratory area name and make the unresolved question explicit in the requirement or scenario.
|
|
30
|
-
|
|
31
|
-
These specs are planning artifacts under the workspace change root. Do not create repo-local spec files in linked repos during workspace planning.
|
|
32
|
-
|
|
33
|
-
Delta operations (use ## headers):
|
|
34
|
-
- **ADDED Requirements**: New workspace-scoped behavior.
|
|
35
|
-
- **MODIFIED Requirements**: Changed behavior; include the full updated requirement.
|
|
36
|
-
- **REMOVED Requirements**: Deprecated behavior with Reason and Migration.
|
|
37
|
-
- **RENAMED Requirements**: Name changes only; use FROM:/TO: format.
|
|
38
|
-
|
|
39
|
-
Each requirement must use SHALL/MUST language and include at least one `#### Scenario:` block.
|
|
40
|
-
requires:
|
|
41
|
-
- proposal
|
|
42
|
-
|
|
43
|
-
- id: design
|
|
44
|
-
generates: design.md
|
|
45
|
-
description: Cross-area technical design and coordination decisions
|
|
46
|
-
template: design.md
|
|
47
|
-
instruction: |
|
|
48
|
-
Create the cross-area design document for workspace planning.
|
|
49
|
-
|
|
50
|
-
Focus on decisions that affect multiple areas, handoffs between areas, shared constraints, sequencing risks, and how the workspace plan should stay the source of truth. Avoid line-by-line implementation details and do not instruct agents to edit linked repos until an explicit implementation workflow provides an allowed edit root.
|
|
51
|
-
requires:
|
|
52
|
-
- proposal
|
|
53
|
-
|
|
54
|
-
- id: tasks
|
|
55
|
-
generates: tasks.md
|
|
56
|
-
description: Coordination checklist for workspace planning and later affected-area implementation
|
|
57
|
-
template: tasks.md
|
|
58
|
-
instruction: |
|
|
59
|
-
Create the workspace coordination task list.
|
|
60
|
-
|
|
61
|
-
Group tasks by phase or affected area as useful. Each actionable item must be a checkbox using `- [ ]`. When implementation tasks are area-specific, name the affected area and keep the task at planning granularity until a later implementation workflow selects an allowed edit root.
|
|
62
|
-
requires:
|
|
63
|
-
- specs
|
|
64
|
-
- design
|
|
65
|
-
|
|
66
|
-
apply:
|
|
67
|
-
requires: [tasks]
|
|
68
|
-
tracks: tasks.md
|
|
69
|
-
instruction: |
|
|
70
|
-
Read the workspace planning context from status and instructions output before applying.
|
|
71
|
-
Select an affected area and confirm an allowed edit root before making implementation edits.
|
|
72
|
-
Until an explicit implementation context is available, treat linked repos and folders as read-only exploration context.
|
|
1
|
+
name: workspace-planning
|
|
2
|
+
version: 1
|
|
3
|
+
description: Workspace planning workflow for cross-area changes
|
|
4
|
+
artifacts:
|
|
5
|
+
- id: proposal
|
|
6
|
+
generates: proposal.md
|
|
7
|
+
description: Shared workspace proposal with the product goal, scope, affected areas, and impact
|
|
8
|
+
template: proposal.md
|
|
9
|
+
instruction: |
|
|
10
|
+
Create the workspace-level proposal that captures the shared product goal once.
|
|
11
|
+
|
|
12
|
+
Sections:
|
|
13
|
+
- **Why**: Explain the product goal or problem in 1-2 concise paragraphs.
|
|
14
|
+
- **What Changes**: List the cross-area behavior, workflow, or capability changes.
|
|
15
|
+
- **Affected Areas**: Name known affected areas using registered workspace link names where applicable. If scope is still being explored, say what remains unresolved.
|
|
16
|
+
- **Capabilities**: Identify workspace-scoped capabilities that need specs. Area-specific requirements should later live under `specs/<area-or-repo>/<capability>/spec.md`.
|
|
17
|
+
- **Impact**: Summarize user-facing impact, planning impact, and likely implementation homes without creating repo-local artifacts.
|
|
18
|
+
|
|
19
|
+
Keep linked repos and folders as exploration context until an explicit implementation workflow selects an affected area.
|
|
20
|
+
requires: []
|
|
21
|
+
|
|
22
|
+
- id: specs
|
|
23
|
+
generates: "specs/**/*.md"
|
|
24
|
+
description: Workspace-scoped specs organized by affected area and capability
|
|
25
|
+
template: spec.md
|
|
26
|
+
instruction: |
|
|
27
|
+
Create workspace-scoped specification files that define WHAT should change.
|
|
28
|
+
|
|
29
|
+
Use `specs/<area-or-repo>/<capability>/spec.md` for area-specific requirements. The first path segment should be a registered workspace link name when a registered area owns the requirement. If the area is unresolved, use an exploratory area name and make the unresolved question explicit in the requirement or scenario.
|
|
30
|
+
|
|
31
|
+
These specs are planning artifacts under the workspace change root. Do not create repo-local spec files in linked repos during workspace planning.
|
|
32
|
+
|
|
33
|
+
Delta operations (use ## headers):
|
|
34
|
+
- **ADDED Requirements**: New workspace-scoped behavior.
|
|
35
|
+
- **MODIFIED Requirements**: Changed behavior; include the full updated requirement.
|
|
36
|
+
- **REMOVED Requirements**: Deprecated behavior with Reason and Migration.
|
|
37
|
+
- **RENAMED Requirements**: Name changes only; use FROM:/TO: format.
|
|
38
|
+
|
|
39
|
+
Each requirement must use SHALL/MUST language and include at least one `#### Scenario:` block.
|
|
40
|
+
requires:
|
|
41
|
+
- proposal
|
|
42
|
+
|
|
43
|
+
- id: design
|
|
44
|
+
generates: design.md
|
|
45
|
+
description: Cross-area technical design and coordination decisions
|
|
46
|
+
template: design.md
|
|
47
|
+
instruction: |
|
|
48
|
+
Create the cross-area design document for workspace planning.
|
|
49
|
+
|
|
50
|
+
Focus on decisions that affect multiple areas, handoffs between areas, shared constraints, sequencing risks, and how the workspace plan should stay the source of truth. Avoid line-by-line implementation details and do not instruct agents to edit linked repos until an explicit implementation workflow provides an allowed edit root.
|
|
51
|
+
requires:
|
|
52
|
+
- proposal
|
|
53
|
+
|
|
54
|
+
- id: tasks
|
|
55
|
+
generates: tasks.md
|
|
56
|
+
description: Coordination checklist for workspace planning and later affected-area implementation
|
|
57
|
+
template: tasks.md
|
|
58
|
+
instruction: |
|
|
59
|
+
Create the workspace coordination task list.
|
|
60
|
+
|
|
61
|
+
Group tasks by phase or affected area as useful. Each actionable item must be a checkbox using `- [ ]`. When implementation tasks are area-specific, name the affected area and keep the task at planning granularity until a later implementation workflow selects an allowed edit root.
|
|
62
|
+
requires:
|
|
63
|
+
- specs
|
|
64
|
+
- design
|
|
65
|
+
|
|
66
|
+
apply:
|
|
67
|
+
requires: [tasks]
|
|
68
|
+
tracks: tasks.md
|
|
69
|
+
instruction: |
|
|
70
|
+
Read the workspace planning context from status and instructions output before applying.
|
|
71
|
+
Select an affected area and confirm an allowed edit root before making implementation edits.
|
|
72
|
+
Until an explicit implementation context is available, treat linked repos and folders as read-only exploration context.
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
## Context
|
|
2
|
-
|
|
3
|
-
Summarize the workspace planning context, relevant linked areas, and constraints.
|
|
4
|
-
|
|
5
|
-
## Goals / Non-Goals
|
|
6
|
-
|
|
7
|
-
**Goals:**
|
|
8
|
-
-
|
|
9
|
-
|
|
10
|
-
**Non-Goals:**
|
|
11
|
-
- Creating repo-local implementation artifacts before an affected area is selected.
|
|
12
|
-
|
|
13
|
-
## Decisions
|
|
14
|
-
|
|
15
|
-
### Decision: <title>
|
|
16
|
-
|
|
17
|
-
<decision and rationale>
|
|
18
|
-
|
|
19
|
-
Alternative considered: <alternative and why it was not chosen>
|
|
20
|
-
|
|
21
|
-
## Risks / Trade-offs
|
|
22
|
-
|
|
23
|
-
- <risk> -> <mitigation>
|
|
24
|
-
|
|
25
|
-
## Coordination Notes
|
|
26
|
-
|
|
27
|
-
- Affected areas:
|
|
28
|
-
- Open handoffs:
|
|
29
|
-
- Implementation entry criteria:
|
|
30
|
-
|
|
31
|
-
## Open Questions
|
|
32
|
-
|
|
33
|
-
-
|
|
1
|
+
## Context
|
|
2
|
+
|
|
3
|
+
Summarize the workspace planning context, relevant linked areas, and constraints.
|
|
4
|
+
|
|
5
|
+
## Goals / Non-Goals
|
|
6
|
+
|
|
7
|
+
**Goals:**
|
|
8
|
+
-
|
|
9
|
+
|
|
10
|
+
**Non-Goals:**
|
|
11
|
+
- Creating repo-local implementation artifacts before an affected area is selected.
|
|
12
|
+
|
|
13
|
+
## Decisions
|
|
14
|
+
|
|
15
|
+
### Decision: <title>
|
|
16
|
+
|
|
17
|
+
<decision and rationale>
|
|
18
|
+
|
|
19
|
+
Alternative considered: <alternative and why it was not chosen>
|
|
20
|
+
|
|
21
|
+
## Risks / Trade-offs
|
|
22
|
+
|
|
23
|
+
- <risk> -> <mitigation>
|
|
24
|
+
|
|
25
|
+
## Coordination Notes
|
|
26
|
+
|
|
27
|
+
- Affected areas:
|
|
28
|
+
- Open handoffs:
|
|
29
|
+
- Implementation entry criteria:
|
|
30
|
+
|
|
31
|
+
## Open Questions
|
|
32
|
+
|
|
33
|
+
-
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
## Why
|
|
2
|
-
|
|
3
|
-
Describe the shared product goal, problem, or opportunity that makes this workspace-level change worth planning.
|
|
4
|
-
|
|
5
|
-
## What Changes
|
|
6
|
-
|
|
7
|
-
-
|
|
8
|
-
|
|
9
|
-
## Affected Areas
|
|
10
|
-
|
|
11
|
-
- Known:
|
|
12
|
-
- Unresolved:
|
|
13
|
-
|
|
14
|
-
## Capabilities
|
|
15
|
-
|
|
16
|
-
### New Capabilities
|
|
17
|
-
|
|
18
|
-
-
|
|
19
|
-
|
|
20
|
-
### Modified Capabilities
|
|
21
|
-
|
|
22
|
-
-
|
|
23
|
-
|
|
24
|
-
## Impact
|
|
25
|
-
|
|
26
|
-
- Workspace planning:
|
|
27
|
-
- Linked repos or folders:
|
|
28
|
-
- User-facing behavior:
|
|
1
|
+
## Why
|
|
2
|
+
|
|
3
|
+
Describe the shared product goal, problem, or opportunity that makes this workspace-level change worth planning.
|
|
4
|
+
|
|
5
|
+
## What Changes
|
|
6
|
+
|
|
7
|
+
-
|
|
8
|
+
|
|
9
|
+
## Affected Areas
|
|
10
|
+
|
|
11
|
+
- Known:
|
|
12
|
+
- Unresolved:
|
|
13
|
+
|
|
14
|
+
## Capabilities
|
|
15
|
+
|
|
16
|
+
### New Capabilities
|
|
17
|
+
|
|
18
|
+
-
|
|
19
|
+
|
|
20
|
+
### Modified Capabilities
|
|
21
|
+
|
|
22
|
+
-
|
|
23
|
+
|
|
24
|
+
## Impact
|
|
25
|
+
|
|
26
|
+
- Workspace planning:
|
|
27
|
+
- Linked repos or folders:
|
|
28
|
+
- User-facing behavior:
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
## ADDED Requirements
|
|
2
|
-
|
|
3
|
-
### Requirement: <workspace requirement name>
|
|
4
|
-
The workspace plan SHALL describe the required behavior and affected area without creating repo-local artifacts during planning.
|
|
5
|
-
|
|
6
|
-
#### Scenario: <scenario name>
|
|
7
|
-
- **GIVEN** <context>
|
|
8
|
-
- **WHEN** <action>
|
|
9
|
-
- **THEN** <observable result>
|
|
1
|
+
## ADDED Requirements
|
|
2
|
+
|
|
3
|
+
### Requirement: <workspace requirement name>
|
|
4
|
+
The workspace plan SHALL describe the required behavior and affected area without creating repo-local artifacts during planning.
|
|
5
|
+
|
|
6
|
+
#### Scenario: <scenario name>
|
|
7
|
+
- **GIVEN** <context>
|
|
8
|
+
- **WHEN** <action>
|
|
9
|
+
- **THEN** <observable result>
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
## 1. Workspace Planning
|
|
2
|
-
|
|
3
|
-
- [ ] 1.1 Confirm the shared product goal and unresolved scope questions.
|
|
4
|
-
- [ ] 1.2 Identify affected areas using registered workspace link names where applicable.
|
|
5
|
-
- [ ] 1.3 Review workspace-scoped specs and design before selecting implementation areas.
|
|
6
|
-
|
|
7
|
-
## 2. Affected Area Implementation
|
|
8
|
-
|
|
9
|
-
- [ ] 2.1 Select an affected area and confirm its allowed edit root before implementation.
|
|
10
|
-
- [ ] 2.2 Create or update repo-local implementation artifacts only after the area is selected.
|
|
11
|
-
|
|
12
|
-
## 3. Verification
|
|
13
|
-
|
|
14
|
-
- [ ] 3.1 Verify workspace planning artifacts remain the source of truth.
|
|
15
|
-
- [ ] 3.2 Record manual acceptance evidence and follow-up fixes.
|
|
1
|
+
## 1. Workspace Planning
|
|
2
|
+
|
|
3
|
+
- [ ] 1.1 Confirm the shared product goal and unresolved scope questions.
|
|
4
|
+
- [ ] 1.2 Identify affected areas using registered workspace link names where applicable.
|
|
5
|
+
- [ ] 1.3 Review workspace-scoped specs and design before selecting implementation areas.
|
|
6
|
+
|
|
7
|
+
## 2. Affected Area Implementation
|
|
8
|
+
|
|
9
|
+
- [ ] 2.1 Select an affected area and confirm its allowed edit root before implementation.
|
|
10
|
+
- [ ] 2.2 Create or update repo-local implementation artifacts only after the area is selected.
|
|
11
|
+
|
|
12
|
+
## 3. Verification
|
|
13
|
+
|
|
14
|
+
- [ ] 3.1 Verify workspace planning artifacts remain the source of truth.
|
|
15
|
+
- [ ] 3.2 Record manual acceptance evidence and follow-up fixes.
|
package/scripts/postinstall.js
CHANGED
|
@@ -1,83 +1,83 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Postinstall script that hints about shell completions
|
|
5
|
-
*
|
|
6
|
-
* Completion installation is opt-in: the user must run
|
|
7
|
-
* `pscode completion install` explicitly. This script only
|
|
8
|
-
* prints a one-line tip after npm install.
|
|
9
|
-
*
|
|
10
|
-
* The tip is suppressed when:
|
|
11
|
-
* - CI=true environment variable is set
|
|
12
|
-
* - PSCODE_NO_COMPLETIONS=1 environment variable is set
|
|
13
|
-
* - dist/ directory doesn't exist (dev setup scenario)
|
|
14
|
-
*
|
|
15
|
-
* The script never fails npm install - all errors are caught and handled gracefully.
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
import { promises as fs } from 'fs';
|
|
19
|
-
import path from 'path';
|
|
20
|
-
import { fileURLToPath } from 'url';
|
|
21
|
-
|
|
22
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
23
|
-
const __dirname = path.dirname(__filename);
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Check if we should skip installation
|
|
27
|
-
*/
|
|
28
|
-
function shouldSkipInstallation() {
|
|
29
|
-
// Skip in CI environments
|
|
30
|
-
if (process.env.CI === 'true' || process.env.CI === '1') {
|
|
31
|
-
return { skip: true, reason: 'CI environment detected' };
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
// Skip if user opted out
|
|
35
|
-
if (process.env.PSCODE_NO_COMPLETIONS === '1') {
|
|
36
|
-
return { skip: true, reason: 'PSCODE_NO_COMPLETIONS=1 set' };
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
return { skip: false };
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Check if dist/ directory exists
|
|
44
|
-
*/
|
|
45
|
-
async function distExists() {
|
|
46
|
-
const distPath = path.join(__dirname, '..', 'dist');
|
|
47
|
-
try {
|
|
48
|
-
const stat = await fs.stat(distPath);
|
|
49
|
-
return stat.isDirectory();
|
|
50
|
-
} catch {
|
|
51
|
-
return false;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Main function
|
|
57
|
-
*/
|
|
58
|
-
async function main() {
|
|
59
|
-
try {
|
|
60
|
-
// Check if we should skip
|
|
61
|
-
const skipCheck = shouldSkipInstallation();
|
|
62
|
-
if (skipCheck.skip) {
|
|
63
|
-
// Silent skip - no output
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
// Check if dist/ exists (skip silently if not - expected during dev setup)
|
|
68
|
-
if (!(await distExists())) {
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
// Completions are opt-in — just print a hint
|
|
73
|
-
console.log(`\nTip: Run 'pscode completion install' for shell completions`);
|
|
74
|
-
} catch (error) {
|
|
75
|
-
// Fail gracefully - never break npm install
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
// Run main and handle any unhandled errors
|
|
80
|
-
main().catch(() => {
|
|
81
|
-
// Silent failure - never break npm install
|
|
82
|
-
process.exit(0);
|
|
83
|
-
});
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Postinstall script that hints about shell completions
|
|
5
|
+
*
|
|
6
|
+
* Completion installation is opt-in: the user must run
|
|
7
|
+
* `pscode completion install` explicitly. This script only
|
|
8
|
+
* prints a one-line tip after npm install.
|
|
9
|
+
*
|
|
10
|
+
* The tip is suppressed when:
|
|
11
|
+
* - CI=true environment variable is set
|
|
12
|
+
* - PSCODE_NO_COMPLETIONS=1 environment variable is set
|
|
13
|
+
* - dist/ directory doesn't exist (dev setup scenario)
|
|
14
|
+
*
|
|
15
|
+
* The script never fails npm install - all errors are caught and handled gracefully.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import { promises as fs } from 'fs';
|
|
19
|
+
import path from 'path';
|
|
20
|
+
import { fileURLToPath } from 'url';
|
|
21
|
+
|
|
22
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
23
|
+
const __dirname = path.dirname(__filename);
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Check if we should skip installation
|
|
27
|
+
*/
|
|
28
|
+
function shouldSkipInstallation() {
|
|
29
|
+
// Skip in CI environments
|
|
30
|
+
if (process.env.CI === 'true' || process.env.CI === '1') {
|
|
31
|
+
return { skip: true, reason: 'CI environment detected' };
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// Skip if user opted out
|
|
35
|
+
if (process.env.PSCODE_NO_COMPLETIONS === '1') {
|
|
36
|
+
return { skip: true, reason: 'PSCODE_NO_COMPLETIONS=1 set' };
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return { skip: false };
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Check if dist/ directory exists
|
|
44
|
+
*/
|
|
45
|
+
async function distExists() {
|
|
46
|
+
const distPath = path.join(__dirname, '..', 'dist');
|
|
47
|
+
try {
|
|
48
|
+
const stat = await fs.stat(distPath);
|
|
49
|
+
return stat.isDirectory();
|
|
50
|
+
} catch {
|
|
51
|
+
return false;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Main function
|
|
57
|
+
*/
|
|
58
|
+
async function main() {
|
|
59
|
+
try {
|
|
60
|
+
// Check if we should skip
|
|
61
|
+
const skipCheck = shouldSkipInstallation();
|
|
62
|
+
if (skipCheck.skip) {
|
|
63
|
+
// Silent skip - no output
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// Check if dist/ exists (skip silently if not - expected during dev setup)
|
|
68
|
+
if (!(await distExists())) {
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// Completions are opt-in — just print a hint
|
|
73
|
+
console.log(`\nTip: Run 'pscode completion install' for shell completions`);
|
|
74
|
+
} catch (error) {
|
|
75
|
+
// Fail gracefully - never break npm install
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// Run main and handle any unhandled errors
|
|
80
|
+
main().catch(() => {
|
|
81
|
+
// Silent failure - never break npm install
|
|
82
|
+
process.exit(0);
|
|
83
|
+
});
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Skill Template Workflow Modules
|
|
3
|
-
*
|
|
4
|
-
* This file is generated by splitting the legacy monolithic
|
|
5
|
-
* templates file into workflow-focused modules.
|
|
6
|
-
*/
|
|
7
|
-
import type { SkillTemplate, CommandTemplate } from '../types.js';
|
|
8
|
-
export declare function getSyncSpecsSkillTemplate(): SkillTemplate;
|
|
9
|
-
export declare function getPsSyncCommandTemplate(): CommandTemplate;
|
|
10
|
-
//# sourceMappingURL=sync-specs.d.ts.map
|