soloship 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 +252 -0
- package/bin/soloship.js +2 -0
- package/dist/artifacts.d.ts +83 -0
- package/dist/artifacts.js +241 -0
- package/dist/ci.d.ts +2 -0
- package/dist/ci.js +184 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +63 -0
- package/dist/detect.d.ts +30 -0
- package/dist/detect.js +127 -0
- package/dist/doctor.d.ts +10 -0
- package/dist/doctor.js +205 -0
- package/dist/hooks.d.ts +2 -0
- package/dist/hooks.js +477 -0
- package/dist/init.d.ts +5 -0
- package/dist/init.js +94 -0
- package/dist/manifest.d.ts +63 -0
- package/dist/manifest.js +90 -0
- package/dist/pkg.d.ts +1 -0
- package/dist/pkg.js +9 -0
- package/dist/rollback.d.ts +12 -0
- package/dist/rollback.js +129 -0
- package/dist/rules.d.ts +1 -0
- package/dist/rules.js +119 -0
- package/dist/scaffold.d.ts +7 -0
- package/dist/scaffold.js +138 -0
- package/dist/templates.d.ts +5 -0
- package/dist/templates.js +175 -0
- package/dist/upgrade.d.ts +12 -0
- package/dist/upgrade.js +62 -0
- package/package.json +38 -0
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
export function generateClaudeMd(project) {
|
|
2
|
+
const stackLine = [
|
|
3
|
+
project.stack.language === "typescript"
|
|
4
|
+
? "TypeScript"
|
|
5
|
+
: project.stack.language === "javascript"
|
|
6
|
+
? "JavaScript"
|
|
7
|
+
: project.stack.language === "python"
|
|
8
|
+
? "Python"
|
|
9
|
+
: "",
|
|
10
|
+
project.stack.framework || "",
|
|
11
|
+
]
|
|
12
|
+
.filter(Boolean)
|
|
13
|
+
.join(" + ");
|
|
14
|
+
return `# CLAUDE.md — AI Assistant Guide
|
|
15
|
+
|
|
16
|
+
**${project.name}**${project.description ? ` — ${project.description}` : ""}
|
|
17
|
+
|
|
18
|
+
${stackLine ? `**Stack:** ${stackLine}\n` : ""}
|
|
19
|
+
## Related Documentation
|
|
20
|
+
|
|
21
|
+
| Document | Location | Purpose |
|
|
22
|
+
|----------|----------|---------|
|
|
23
|
+
| Changelog | [CHANGELOG.md](CHANGELOG.md) | Version history and release notes |
|
|
24
|
+
| Solution Guide | [docs/SOLUTION_GUIDE.md](docs/SOLUTION_GUIDE.md) | Solution doc schema and template |
|
|
25
|
+
|
|
26
|
+
## Project Structure
|
|
27
|
+
|
|
28
|
+
\`\`\`
|
|
29
|
+
TODO: Run /audit or /bootstrap to populate this section
|
|
30
|
+
\`\`\`
|
|
31
|
+
|
|
32
|
+
## Quick Commands
|
|
33
|
+
|
|
34
|
+
\`\`\`bash
|
|
35
|
+
# TODO: Add project-specific commands here
|
|
36
|
+
\`\`\`
|
|
37
|
+
|
|
38
|
+
## Intent Layer
|
|
39
|
+
|
|
40
|
+
**Before modifying code in a subdirectory, read its AGENTS.md first.**
|
|
41
|
+
|
|
42
|
+
## Cross-Cutting Contracts
|
|
43
|
+
|
|
44
|
+
<!-- TODO: Run /audit to discover cross-cutting contracts -->
|
|
45
|
+
|
|
46
|
+
## Global Invariants
|
|
47
|
+
|
|
48
|
+
<!-- TODO: Add project-specific invariants discovered by /audit -->
|
|
49
|
+
|
|
50
|
+
## Workflow
|
|
51
|
+
|
|
52
|
+
This project follows: **THINK → PLAN → WORK → LEARN → SHIP**
|
|
53
|
+
|
|
54
|
+
| Phase | Tool | When to Upgrade |
|
|
55
|
+
|-------|------|-----------------|
|
|
56
|
+
| Think | /brainstorm | Always start here for new work |
|
|
57
|
+
| Plan | /plan | After brainstorming + visual design |
|
|
58
|
+
| Work | /implement | Execute the plan |
|
|
59
|
+
| Learn | /learn | After non-obvious fixes |
|
|
60
|
+
| Ship | /shipfast or /shipthorough | Fast for hotfixes, thorough for features |
|
|
61
|
+
|
|
62
|
+
## Rules
|
|
63
|
+
|
|
64
|
+
Coding conventions and workflow rules auto-load from \`.claude/rules/\`.
|
|
65
|
+
`;
|
|
66
|
+
}
|
|
67
|
+
export function generateAgentsMd(project) {
|
|
68
|
+
return `# AGENTS.md — Project Root
|
|
69
|
+
|
|
70
|
+
## Scope
|
|
71
|
+
|
|
72
|
+
Top-level project configuration, documentation, and cross-cutting concerns.
|
|
73
|
+
|
|
74
|
+
## Owns
|
|
75
|
+
|
|
76
|
+
- CLAUDE.md — project configuration for AI agents
|
|
77
|
+
- CHANGELOG.md — version history
|
|
78
|
+
- docs/ — plans, solutions, architecture, audit reports
|
|
79
|
+
- Project configuration files (package.json, tsconfig.json, etc.)
|
|
80
|
+
|
|
81
|
+
## Contracts
|
|
82
|
+
|
|
83
|
+
- All subdirectories should have their own AGENTS.md describing scope and contracts
|
|
84
|
+
- Changes to shared types or interfaces must be noted in CHANGELOG.md
|
|
85
|
+
- Plans go in docs/plans/, solutions go in docs/solutions/
|
|
86
|
+
|
|
87
|
+
## Key Files
|
|
88
|
+
|
|
89
|
+
| File | Purpose |
|
|
90
|
+
|------|---------|
|
|
91
|
+
| CLAUDE.md | AI agent configuration |
|
|
92
|
+
| CHANGELOG.md | Version history |
|
|
93
|
+
| docs/SOLUTION_GUIDE.md | Schema for solution docs |
|
|
94
|
+
|
|
95
|
+
<!-- Run /audit to discover and populate subdirectory AGENTS.md files -->
|
|
96
|
+
`;
|
|
97
|
+
}
|
|
98
|
+
export function generateChangelog(project) {
|
|
99
|
+
const today = new Date().toISOString().split("T")[0];
|
|
100
|
+
return `# Changelog
|
|
101
|
+
|
|
102
|
+
All notable changes to this project will be documented in this file.
|
|
103
|
+
|
|
104
|
+
## [Unreleased]
|
|
105
|
+
|
|
106
|
+
### Added
|
|
107
|
+
- Soloship initialized (${today})
|
|
108
|
+
`;
|
|
109
|
+
}
|
|
110
|
+
export function generateSolutionGuide() {
|
|
111
|
+
return `# Solution Guide
|
|
112
|
+
|
|
113
|
+
## What Goes Here
|
|
114
|
+
|
|
115
|
+
Every non-obvious fix or significant feature produces a solution doc. These accumulate
|
|
116
|
+
in \`docs/solutions/<category>/\` and are searched before every planning session.
|
|
117
|
+
|
|
118
|
+
## Categories
|
|
119
|
+
|
|
120
|
+
- api-issues
|
|
121
|
+
- auth-bugs
|
|
122
|
+
- infrastructure
|
|
123
|
+
- integration-issues
|
|
124
|
+
- pdf-issues
|
|
125
|
+
- performance
|
|
126
|
+
- refactoring
|
|
127
|
+
- security
|
|
128
|
+
- ui-bugs
|
|
129
|
+
|
|
130
|
+
Create new categories as needed.
|
|
131
|
+
|
|
132
|
+
## Template
|
|
133
|
+
|
|
134
|
+
\`\`\`markdown
|
|
135
|
+
---
|
|
136
|
+
title: Short descriptive title
|
|
137
|
+
date: YYYY-MM-DD
|
|
138
|
+
category: one-of-the-above
|
|
139
|
+
components: [list, of, affected, components]
|
|
140
|
+
files: [list, of, key, files]
|
|
141
|
+
symptoms: [what, the, user, sees]
|
|
142
|
+
error_messages: [exact, error, strings]
|
|
143
|
+
tags: [searchable, keywords]
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
## Problem
|
|
147
|
+
|
|
148
|
+
What went wrong. Include error messages, screenshots, or reproduction steps.
|
|
149
|
+
|
|
150
|
+
## Root Cause
|
|
151
|
+
|
|
152
|
+
Why it happened. Be specific — name the file, line, and mechanism.
|
|
153
|
+
|
|
154
|
+
## Solution
|
|
155
|
+
|
|
156
|
+
What was done to fix it. Include code snippets if helpful.
|
|
157
|
+
|
|
158
|
+
## Prevention
|
|
159
|
+
|
|
160
|
+
How to prevent this from happening again. This is the most important section.
|
|
161
|
+
Rules, tests, or checks that should be added.
|
|
162
|
+
|
|
163
|
+
## Related
|
|
164
|
+
|
|
165
|
+
Links to PRs, issues, or other solution docs.
|
|
166
|
+
\`\`\`
|
|
167
|
+
|
|
168
|
+
## When to Write One
|
|
169
|
+
|
|
170
|
+
- After any bug fix that took more than 15 minutes to diagnose
|
|
171
|
+
- After any feature that required non-obvious architectural decisions
|
|
172
|
+
- After any refactoring that changed how components interact
|
|
173
|
+
- When you discover a gotcha that would bite future developers
|
|
174
|
+
`;
|
|
175
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `soloship upgrade` — refresh the project's Soloship infrastructure to the
|
|
3
|
+
* version of Soloship currently being executed via npx.
|
|
4
|
+
*
|
|
5
|
+
* Refreshes: hooks, rules, CI workflow, version stamp.
|
|
6
|
+
* Preserves: CLAUDE.md, AGENTS.md, CHANGELOG.md, docs/, and any user content.
|
|
7
|
+
*
|
|
8
|
+
* The hooks installer already overwrites `.claude/settings.local.json`'s hooks
|
|
9
|
+
* key wholesale, so users who hand-edited hooks will lose those changes — same
|
|
10
|
+
* behavior as re-running `init`.
|
|
11
|
+
*/
|
|
12
|
+
export declare function runUpgrade(): Promise<void>;
|
package/dist/upgrade.js
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import chalk from "chalk";
|
|
2
|
+
import { detectProject } from "./detect.js";
|
|
3
|
+
import { installHooks } from "./hooks.js";
|
|
4
|
+
import { installRules } from "./rules.js";
|
|
5
|
+
import { installCi } from "./ci.js";
|
|
6
|
+
import { writeVersionStamp } from "./scaffold.js";
|
|
7
|
+
import { getVersion } from "./pkg.js";
|
|
8
|
+
/**
|
|
9
|
+
* `soloship upgrade` — refresh the project's Soloship infrastructure to the
|
|
10
|
+
* version of Soloship currently being executed via npx.
|
|
11
|
+
*
|
|
12
|
+
* Refreshes: hooks, rules, CI workflow, version stamp.
|
|
13
|
+
* Preserves: CLAUDE.md, AGENTS.md, CHANGELOG.md, docs/, and any user content.
|
|
14
|
+
*
|
|
15
|
+
* The hooks installer already overwrites `.claude/settings.local.json`'s hooks
|
|
16
|
+
* key wholesale, so users who hand-edited hooks will lose those changes — same
|
|
17
|
+
* behavior as re-running `init`.
|
|
18
|
+
*/
|
|
19
|
+
export async function runUpgrade() {
|
|
20
|
+
const root = process.cwd();
|
|
21
|
+
console.log(chalk.blue("Detecting project..."));
|
|
22
|
+
const detected = detectProject(root);
|
|
23
|
+
const stack = detected.stack;
|
|
24
|
+
const existingDocs = detected.existingDocs;
|
|
25
|
+
const projectInfo = {
|
|
26
|
+
name: detected.name || root.split("/").pop() || "my-project",
|
|
27
|
+
description: "",
|
|
28
|
+
stack,
|
|
29
|
+
hasGit: detected.hasGit || false,
|
|
30
|
+
hasClaude: detected.hasClaude || false,
|
|
31
|
+
existingDocs,
|
|
32
|
+
};
|
|
33
|
+
console.log("");
|
|
34
|
+
console.log(chalk.blue("Refreshing Claude Code hooks..."));
|
|
35
|
+
const hookResults = await installHooks(root, projectInfo);
|
|
36
|
+
for (const result of hookResults) {
|
|
37
|
+
console.log(` ${chalk.green("+")} ${result}`);
|
|
38
|
+
}
|
|
39
|
+
console.log("");
|
|
40
|
+
console.log(chalk.blue("Refreshing workflow rules..."));
|
|
41
|
+
const ruleResults = await installRules(root, { force: true });
|
|
42
|
+
for (const result of ruleResults) {
|
|
43
|
+
console.log(` ${chalk.green("+")} ${result}`);
|
|
44
|
+
}
|
|
45
|
+
console.log("");
|
|
46
|
+
console.log(chalk.blue("Refreshing CI..."));
|
|
47
|
+
const ciResults = await installCi(root, projectInfo);
|
|
48
|
+
for (const result of ciResults) {
|
|
49
|
+
console.log(` ${chalk.green("+")} ${result}`);
|
|
50
|
+
}
|
|
51
|
+
console.log("");
|
|
52
|
+
console.log(chalk.blue("Updating version stamp..."));
|
|
53
|
+
const stampResults = writeVersionStamp(root);
|
|
54
|
+
for (const result of stampResults) {
|
|
55
|
+
const icon = result.action === "created" ? chalk.green("+") : chalk.yellow("~");
|
|
56
|
+
console.log(` ${icon} ${result.path} ${chalk.dim(`(${result.action})`)}`);
|
|
57
|
+
}
|
|
58
|
+
console.log("");
|
|
59
|
+
console.log(chalk.green.bold(`Soloship upgraded to v${getVersion()}.`));
|
|
60
|
+
console.log(chalk.dim(" Project docs (CLAUDE.md, AGENTS.md, CHANGELOG.md) were preserved."));
|
|
61
|
+
console.log("");
|
|
62
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "soloship",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Systematic programming methodology for AI-assisted development",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"soloship": "bin/soloship.js"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"build": "tsc",
|
|
11
|
+
"dev": "tsc --watch",
|
|
12
|
+
"start": "node dist/cli.js",
|
|
13
|
+
"prepare": "tsc"
|
|
14
|
+
},
|
|
15
|
+
"keywords": [
|
|
16
|
+
"claude-code",
|
|
17
|
+
"ai-development",
|
|
18
|
+
"methodology",
|
|
19
|
+
"code-quality"
|
|
20
|
+
],
|
|
21
|
+
"license": "MIT",
|
|
22
|
+
"engines": {
|
|
23
|
+
"node": ">=20"
|
|
24
|
+
},
|
|
25
|
+
"files": [
|
|
26
|
+
"dist",
|
|
27
|
+
"bin"
|
|
28
|
+
],
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"@inquirer/prompts": "^7.10.0",
|
|
31
|
+
"chalk": "^5.4.0",
|
|
32
|
+
"commander": "^13.1.0"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@types/node": "^22.15.0",
|
|
36
|
+
"typescript": "^5.8.0"
|
|
37
|
+
}
|
|
38
|
+
}
|