plankit-cli 1.0.0 → 1.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/src/config.js ADDED
@@ -0,0 +1,208 @@
1
+ import fs from 'node:fs';
2
+ import path from 'node:path';
3
+
4
+ export const DEFAULT_CONFIG = {
5
+ artifactsDir: 'artifacts',
6
+ overwrite: 'skip',
7
+ agents: {
8
+ codex: true,
9
+ cursor: true,
10
+ opencode: true,
11
+ gemini: true
12
+ },
13
+ defaultPhases: [
14
+ {
15
+ title: 'Foundation & Setup',
16
+ slug: 'foundation',
17
+ objective: 'Establish the base structure, constraints, and integration points.',
18
+ tasks: ['Confirm scope and constraints', 'Prepare base structure', 'Document implementation notes']
19
+ },
20
+ {
21
+ title: 'Core Implementation',
22
+ slug: 'core-implementation',
23
+ objective: 'Implement the primary behavior for the feature.',
24
+ tasks: ['Implement core changes', 'Update related documentation or examples', 'Record migration notes if needed']
25
+ },
26
+ {
27
+ title: 'Testing & Verification',
28
+ slug: 'testing-verification',
29
+ objective: 'Verify behavior and complete the Definition of Done.',
30
+ tasks: ['Add or update tests', 'Run verification commands', 'Document final outcome']
31
+ }
32
+ ],
33
+ verification: {
34
+ testCommand: 'npm test',
35
+ buildCommand: 'npm run build'
36
+ },
37
+ templatesDir: null
38
+ };
39
+
40
+ const CONFIG_FILES = [
41
+ 'plankit.config.json',
42
+ '.plankitrc.json',
43
+ path.join('.plankit', 'config.json')
44
+ ];
45
+
46
+ export function loadConfig(cwd = process.cwd()) {
47
+ const configPath = CONFIG_FILES
48
+ .map((file) => path.join(cwd, file))
49
+ .find((file) => fs.existsSync(file));
50
+
51
+ if (!configPath) {
52
+ return { config: normalizeConfig(DEFAULT_CONFIG), path: null };
53
+ }
54
+
55
+ const parsed = JSON.parse(fs.readFileSync(configPath, 'utf8'));
56
+ return {
57
+ config: normalizeConfig(deepMerge(DEFAULT_CONFIG, parsed)),
58
+ path: configPath
59
+ };
60
+ }
61
+
62
+ export function createDefaultConfigFile(cwd, options = {}) {
63
+ const filePath = path.join(cwd, 'plankit.config.json');
64
+ const content = `${JSON.stringify(DEFAULT_CONFIG, null, 2)}\n`;
65
+ return writeManagedFile(filePath, content, options);
66
+ }
67
+
68
+ export function normalizeConfig(config) {
69
+ const normalized = structuredClone(config);
70
+ normalized.defaultPhases = normalizePhases(normalized.defaultPhases);
71
+ normalized.artifactsDir = normalized.artifactsDir || DEFAULT_CONFIG.artifactsDir;
72
+ normalized.overwrite = normalized.overwrite || DEFAULT_CONFIG.overwrite;
73
+ normalized.agents = { ...DEFAULT_CONFIG.agents, ...(normalized.agents || {}) };
74
+ normalized.verification = { ...DEFAULT_CONFIG.verification, ...(normalized.verification || {}) };
75
+ return normalized;
76
+ }
77
+
78
+ export function normalizePhases(phases) {
79
+ if (!Array.isArray(phases) || phases.length === 0) {
80
+ return DEFAULT_CONFIG.defaultPhases;
81
+ }
82
+
83
+ return phases.map((phase, index) => {
84
+ if (typeof phase === 'string') {
85
+ return {
86
+ title: phase,
87
+ slug: slugify(phase) || `phase-${index + 1}`,
88
+ objective: `Complete ${phase}.`,
89
+ tasks: [`Complete ${phase}`, 'Document outcome']
90
+ };
91
+ }
92
+
93
+ const title = phase.title || `Phase ${index + 1}`;
94
+ return {
95
+ title,
96
+ slug: phase.slug || slugify(title) || `phase-${index + 1}`,
97
+ objective: phase.objective || `Complete ${title}.`,
98
+ tasks: Array.isArray(phase.tasks) && phase.tasks.length > 0
99
+ ? phase.tasks
100
+ : [`Complete ${title}`, 'Document outcome']
101
+ };
102
+ });
103
+ }
104
+
105
+ export function parsePhaseFlag(value) {
106
+ if (!value) {
107
+ return null;
108
+ }
109
+
110
+ const count = Number.parseInt(value, 10);
111
+ if (String(count) === value && count > 0) {
112
+ return Array.from({ length: count }, (_, index) => {
113
+ const defaultPhase = DEFAULT_CONFIG.defaultPhases[index];
114
+ return defaultPhase || {
115
+ title: `Phase ${index + 1}`,
116
+ slug: `phase-${index + 1}`,
117
+ objective: `Complete Phase ${index + 1}.`,
118
+ tasks: [`Complete Phase ${index + 1}`, 'Document outcome']
119
+ };
120
+ });
121
+ }
122
+
123
+ return normalizePhases(value.split(',').map((item) => item.trim()).filter(Boolean));
124
+ }
125
+
126
+ export function slugify(value) {
127
+ return String(value)
128
+ .trim()
129
+ .toLowerCase()
130
+ .replace(/[^a-z0-9._-]+/g, '-')
131
+ .replace(/^-+|-+$/g, '');
132
+ }
133
+
134
+ export function assertSafeName(name, label = 'name') {
135
+ if (!name || name === '.' || name === '..' || /[\\/]/.test(name) || !/^[a-zA-Z0-9][a-zA-Z0-9._-]*$/.test(name)) {
136
+ throw new Error(`Invalid ${label} "${name}". Use letters, numbers, ".", "_" or "-" without path separators.`);
137
+ }
138
+ }
139
+
140
+ export function safeJoin(root, ...segments) {
141
+ const resolvedRoot = path.resolve(root);
142
+ const target = path.resolve(resolvedRoot, ...segments);
143
+ const relative = path.relative(resolvedRoot, target);
144
+
145
+ if (relative.startsWith('..') || path.isAbsolute(relative)) {
146
+ throw new Error(`Refusing to access path outside project: ${target}`);
147
+ }
148
+
149
+ return target;
150
+ }
151
+
152
+ export function ensureDir(dirPath, options = {}) {
153
+ if (options.dryRun) {
154
+ return;
155
+ }
156
+ fs.mkdirSync(dirPath, { recursive: true });
157
+ }
158
+
159
+ export function writeManagedFile(filePath, content, options = {}) {
160
+ const exists = fs.existsSync(filePath);
161
+ const same = exists && fs.readFileSync(filePath, 'utf8') === content;
162
+
163
+ if (same) {
164
+ return { path: filePath, action: 'unchanged' };
165
+ }
166
+
167
+ if (exists && !options.force) {
168
+ return { path: filePath, action: 'skipped' };
169
+ }
170
+
171
+ if (!options.dryRun) {
172
+ fs.mkdirSync(path.dirname(filePath), { recursive: true });
173
+ fs.writeFileSync(filePath, content, 'utf8');
174
+ }
175
+
176
+ return { path: filePath, action: exists ? 'updated' : 'created' };
177
+ }
178
+
179
+ export function listDirectories(dirPath) {
180
+ if (!fs.existsSync(dirPath)) {
181
+ return [];
182
+ }
183
+
184
+ return fs.readdirSync(dirPath, { withFileTypes: true })
185
+ .filter((entry) => entry.isDirectory() && !entry.name.startsWith('.'))
186
+ .map((entry) => entry.name)
187
+ .sort((a, b) => a.localeCompare(b));
188
+ }
189
+
190
+ function deepMerge(base, override) {
191
+ if (Array.isArray(base) || Array.isArray(override)) {
192
+ return override ?? base;
193
+ }
194
+
195
+ if (!isPlainObject(base) || !isPlainObject(override)) {
196
+ return override ?? base;
197
+ }
198
+
199
+ const result = { ...base };
200
+ for (const [key, value] of Object.entries(override)) {
201
+ result[key] = deepMerge(base[key], value);
202
+ }
203
+ return result;
204
+ }
205
+
206
+ function isPlainObject(value) {
207
+ return value !== null && typeof value === 'object' && Object.getPrototypeOf(value) === Object.prototype;
208
+ }
package/src/templates.js CHANGED
@@ -1,149 +1,25 @@
1
- export const AGENTS_MD_TEMPLATE = `# AGENTS.md — PlanKit Command Suite for AI Agents
2
-
3
- All AI coding assistants (Codex, Claude Code, OpenCode, Antigravity, Cursor) interacting with this codebase must follow the **PlanKit Command Suite**:
4
-
5
- ## Commands
6
-
7
- 1. \`plankit.plan\` (or \`/plankit-plan\`): Initialize feature under \`artifacts/current/<feature-name>/\`, create \`README.md\` progress matrix, and write \`phases/phase-N-*.md\` specs.
8
- 2. \`plankit.clarify\` (or \`/plankit-clarify\`): Analyze requirements and ask targeted clarifying questions before executing code edits.
9
- 3. \`plankit.implement\` (or \`/plankit-implement\`): Execute Phase N by reading \`phases/phase-N.md\` **AND all previous outputs** (\`outputs/phase-1..N-1-output.md\`), writing \`outputs/phase-N-output.md\`, and updating \`README.md\`.
10
- 4. \`plankit.review\` (or \`/plankit-review\`): Run test & build verification, validate DoD, and move feature folder to \`artifacts/archived/<feature-name>\`.
11
-
12
- Canonical Specification: \`artifacts/PLANKIT.md\`
13
- `;
14
-
15
- export const CURSORRULES_TEMPLATE = `# Cursor AI Rules — PlanKit Command Suite
16
-
17
- You MUST follow the PlanKit multi-phase feature development standard defined in \`artifacts/PLANKIT.md\`.
18
-
19
- ## Recognized PlanKit Commands
20
-
21
- - **plankit.plan**: Create \`artifacts/current/<feature-name>/\`, master \`README.md\`, and \`phases/phase-N-*.md\` specs.
22
- - **plankit.clarify**: Inspect codebase & specs, then ask structured clarifying questions before editing code.
23
- - **plankit.implement**: Read target spec AND \`outputs/phase-1..N-1-output.md\`, execute changes, write \`outputs/phase-N-output.md\`, and mark Phase N \`[x]\` in \`README.md\`.
24
- - **plankit.review**: Run \`npm run test\` & \`npm run build\`, validate DoD checklist, and move folder to \`artifacts/archived/<feature-name>\`.
25
- `;
26
-
27
- export const GEMINI_INSTRUCTIONS_TEMPLATE = `# Antigravity Workspace Rules — PlanKit Integration
28
-
29
- Whenever working in this workspace, strictly adhere to the **PlanKit Command Suite** defined in \`artifacts/PLANKIT.md\`.
30
-
31
- ## Recognized PlanKit Commands
32
-
33
- ### 1. \`plankit.plan\` [feature-description]
34
- - Create \`artifacts/current/<feature-name>/\`.
35
- - Create \`README.md\` with overview, progress table, and \`[ ]\` checkboxes.
36
- - Create phase specs in \`phases/phase-N-*.md\`.
37
- - Present Phase 1 implementation plan.
38
-
39
- ### 2. \`plankit.clarify\`
40
- - Read \`artifacts/current/<feature-name>/README.md\` and target spec in \`phases/\`.
41
- - Inspect codebase and present structured clarifying questions to user before modifying code.
42
-
43
- ### 3. \`plankit.implement\` [Phase N]
44
- - Read \`phases/phase-N-*.md\` **AND all previous outputs** (\`outputs/phase-1..N-1-output.md\`).
45
- - Execute changes, run tests, write \`outputs/phase-N-output.md\`, and update \`README.md\` (\`[x]\`).
46
-
47
- ### 4. \`plankit.review\`
48
- - Run \`npm run test\` and \`npm run build\`.
49
- - Validate DoD checklist.
50
- - Move completed feature folder from \`artifacts/current/<feature-name>\` to \`artifacts/archived/<feature-name>\`.
51
- `;
52
-
53
- export const OPENCODE_COMMAND_PLAN = `---
54
- description: Initialize a new feature under artifacts/current/<feature-name>/, create README.md progress matrix, and write phases/phase-N-*.md specs.
55
- ---
56
-
57
- Initialize a new feature in the workspace according to PlanKit SOP.
58
-
59
- Requirements: $ARG
60
-
61
- Steps:
62
- 1. Create directory \`artifacts/current/$ARG/\` (or determine feature name from prompt).
63
- 2. Create \`artifacts/current/<feature-name>/README.md\` containing feature overview, architecture summary, DoD checklist, and progress status matrix.
64
- 3. Write phase specification files under \`artifacts/current/<feature-name>/phases/phase-N-<step-name>.md\`.
65
- 4. Generate the detailed Phase 1 implementation plan artifact and request user approval.
66
- `;
67
-
68
- export const OPENCODE_COMMAND_CLARIFY = `---
69
- description: Analyze requirements and codebase to ask targeted clarifying questions before executing code edits.
70
- ---
71
-
72
- Analyze requirements and clarify design decisions according to PlanKit SOP.
73
-
74
- 1. Read \`artifacts/current/<feature-name>/README.md\` and target spec in \`phases/\`.
75
- 2. Inspect relevant codebase files to identify existing patterns, schemas, or potential breaking changes.
76
- 3. Formulate and present structured clarifying questions for the user regarding design choices, API contracts, or edge cases.
77
- 4. Do NOT make code changes until the user responds.
78
- `;
79
-
80
- export const OPENCODE_COMMAND_IMPLEMENT = `---
81
- description: Execute Phase N by reading phases/phase-N.md AND all previous outputs, writing outputs/phase-N-output.md, and updating README.md.
82
- ---
83
-
84
- Execute a feature phase according to PlanKit SOP.
85
-
86
- Phase to implement: $ARG
87
-
88
- 1. Read target phase spec: \`artifacts/current/<feature-name>/phases/phase-N-*.md\`.
89
- 2. **Mandatory Context Load**: Read **ALL** previous output reports: \`outputs/phase-1-output.md\` through \`outputs/phase-(N-1)-output.md\`.
90
- 3. Execute code and configuration modifications.
91
- 4. Run automated tests or build verification commands.
92
- 5. Write execution report to \`artifacts/current/<feature-name>/outputs/phase-N-output.md\`.
93
- 6. Update \`artifacts/current/<feature-name>/README.md\`: mark Phase N as \`[x]\` and update status matrix.
94
- `;
95
-
96
- export const OPENCODE_COMMAND_REVIEW = `---
97
- description: Run test & build verification, validate DoD, and move feature folder to artifacts/archived/<feature-name>.
98
- ---
99
-
100
- Verify a completed feature and archive it according to PlanKit SOP.
101
-
102
- 1. Run full test suite (\`npm run test\`) and production build (\`npm run build\`).
103
- 2. Validate all Definition of Done checklist items in \`artifacts/current/<feature-name>/README.md\`.
104
- 3. Update \`README.md\` header title to \`# Feature: <Feature Name> [ARCHIVED]\`.
105
- 4. Move \`artifacts/current/<feature-name>\` directory to \`artifacts/archived/<feature-name>\`.
106
- 5. Present final completion summary report to user.
107
- `;
108
-
109
- export const OPENCODE_COMMAND_MASTER = `---
110
- description: PlanKit Command Suite master command. Evaluate sub-action (plan, clarify, implement, review).
111
- ---
112
-
113
- PlanKit Command Suite master command.
114
-
115
- Sub-action / Arguments: $ARG
116
-
117
- Evaluate the sub-action:
118
- - \`plan\`: Initialize feature under \`artifacts/current/<feature-name>/\`, create \`README.md\` matrix, and write \`phases/phase-N-*.md\` specs.
119
- - \`clarify\`: Inspect codebase and specs, then ask structured clarifying questions before implementing code.
120
- - \`implement\`: Read target spec AND all previous outputs (\`outputs/phase-1..N-1-output.md\`), execute changes, write \`outputs/phase-N-output.md\`, and update \`README.md\`.
121
- - \`review\`: Run \`npm run test\` & \`npm run build\`, validate DoD checklist, and archive completed feature to \`artifacts/archived/<feature-name>\`.
122
- `;
123
-
124
- export const PLANKIT_SPEC_TEMPLATE = `# PlanKit Command Suite Specification
125
-
126
- > [!IMPORTANT]
127
- > **PlanKit Standard**: PlanKit is a standardized, tool-agnostic command framework for AI coding assistants. It organizes multi-phase feature development into distinct, predictable steps with context-aware execution and automated progress tracking.
128
-
129
- ---
130
-
131
- ## The 4 Core Commands
132
-
133
- ### 1. \`plankit.plan\` [feature-name] [requirements]
134
- - **Purpose**: Initializes a new feature task.
135
- - **Actions**:
136
- 1. Creates feature directory: \`artifacts/current/<feature-name>/\`.
137
- 2. Creates master overview & status tracking table in \`artifacts/current/<feature-name>/README.md\`.
138
- 3. Creates phase specification files: \`artifacts/current/<feature-name>/phases/phase-1-<name>.md\`, \`phase-2-<name>.md\`, etc.
139
- 4. Generates initial Phase 1 implementation plan artifact and requests user approval.
140
-
141
- ### 2. \`plankit.clarify\`
142
- - **Purpose**: Conducts a structured design alignment and requirements interview.
143
-
144
- ### 3. \`plankit.implement\` [Phase N]
145
- - **Purpose**: Executes a single phase with context continuity. Reads \`phases/phase-N.md\` AND all previous outputs (\`outputs/phase-1..N-1-output.md\`).
146
-
147
- ### 4. \`plankit.review\`
148
- - **Purpose**: Verifies Definition of Done (DoD) and archives completed features to \`artifacts/archived/\`.
149
- `;
1
+ import fs from 'node:fs';
2
+ import path from 'node:path';
3
+ import { fileURLToPath } from 'node:url';
4
+
5
+ const packageRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
6
+
7
+ export function renderTemplate(config, templateName, variables = {}, cwd = process.cwd()) {
8
+ const customPath = config.templatesDir
9
+ ? path.resolve(cwd, config.templatesDir, templateName)
10
+ : null;
11
+
12
+ const templatePath = customPath && fs.existsSync(customPath)
13
+ ? customPath
14
+ : path.join(packageRoot, 'templates', templateName);
15
+
16
+ const raw = fs.readFileSync(templatePath, 'utf8');
17
+ return raw.replace(/\{\{([a-zA-Z0-9_.-]+)\}\}/g, (_, key) => {
18
+ const value = variables[key];
19
+ return value === undefined || value === null ? '' : String(value);
20
+ });
21
+ }
22
+
23
+ export function renderList(items, mapper) {
24
+ return items.map(mapper).join('\n');
25
+ }
@@ -0,0 +1,12 @@
1
+ # AGENTS.md — PlanKit Command Suite for AI Agents
2
+
3
+ All AI coding assistants interacting with this codebase must follow the PlanKit Command Suite.
4
+
5
+ ## Commands
6
+
7
+ 1. `plankit.plan` / `/plankit-plan`: initialize a feature under `{{artifactsDir}}/current/<feature-name>/`, create `README.md`, and write phase specs.
8
+ 2. `plankit.clarify` / `/plankit-clarify`: inspect requirements and ask targeted clarifying questions before executing code edits.
9
+ 3. `plankit.implement` / `/plankit-implement`: execute one phase by reading its phase spec and all previous phase outputs.
10
+ 4. `plankit.review` / `/plankit-review`: run verification, validate Definition of Done, and archive the feature.
11
+
12
+ Canonical specification: `{{artifactsDir}}/PLANKIT.md`
@@ -0,0 +1,40 @@
1
+ # PlanKit Command Suite Specification
2
+
3
+ PlanKit is a tool-agnostic command framework for AI coding assistants. It organizes multi-phase feature development into predictable steps with context-aware execution and progress tracking.
4
+
5
+ ## Project Layout
6
+
7
+ ```text
8
+ {{artifactsDir}}/
9
+ PLANKIT.md
10
+ current/
11
+ <feature-name>/
12
+ README.md
13
+ plankit.json
14
+ clarifications.md
15
+ phases/
16
+ outputs/
17
+ archived/
18
+ ```
19
+
20
+ ## Core Commands
21
+
22
+ ### `plankit.plan` [feature-name] [requirements]
23
+
24
+ Initializes a feature task under `{{artifactsDir}}/current/<feature-name>/`.
25
+
26
+ ### `plankit.clarify` [feature-name] [phase]
27
+
28
+ Creates or updates a clarification artifact for unresolved design and requirement questions.
29
+
30
+ ### `plankit.implement` [feature-name] [phase]
31
+
32
+ Prepares the phase output artifact after validating that the phase spec and prior phase outputs exist.
33
+
34
+ ### `plankit.review` [feature-name]
35
+
36
+ Runs configured verification commands and archives the completed feature.
37
+
38
+ ## Customization
39
+
40
+ Configure PlanKit with `plankit.config.json`. Override generated templates by setting `templatesDir` and matching the package template file names.
@@ -0,0 +1,16 @@
1
+ # Clarifications: {{featureName}}
2
+
3
+ ## Context
4
+
5
+ - Feature README: `README.md`
6
+ - Target phase: {{phaseLabel}}
7
+
8
+ ## Questions
9
+
10
+ - [ ] What behavior must be treated as in scope for this phase?
11
+ - [ ] What existing API, schema, or UX contracts must remain stable?
12
+ - [ ] What edge cases should be explicitly handled or deferred?
13
+
14
+ ## Decisions
15
+
16
+ - Pending.
@@ -0,0 +1,10 @@
1
+ # Cursor AI Rules — PlanKit Command Suite
2
+
3
+ Follow the PlanKit multi-phase feature development standard defined in `{{artifactsDir}}/PLANKIT.md`.
4
+
5
+ ## Recognized PlanKit Commands
6
+
7
+ - `plankit.plan`: create `{{artifactsDir}}/current/<feature-name>/`, a master `README.md`, and `phases/phase-N-*.md` specs.
8
+ - `plankit.clarify`: inspect the codebase and specs, then ask structured clarifying questions before editing code.
9
+ - `plankit.implement`: read target spec and previous outputs, execute changes, write `outputs/phase-N-output.md`, and update `README.md`.
10
+ - `plankit.review`: run verification, validate DoD, and archive completed feature work.
@@ -0,0 +1,22 @@
1
+ # Feature: {{featureName}}
2
+
3
+ ## Overview
4
+
5
+ {{requirements}}
6
+
7
+ ## Phase Breakdown & Progress Status
8
+
9
+ {{phaseChecklist}}
10
+
11
+ ## Definition of Done
12
+
13
+ - [ ] Implementation matches the approved phase specs.
14
+ - [ ] Relevant tests or verification commands have passed.
15
+ - [ ] Phase outputs are written under `outputs/`.
16
+ - [ ] Important follow-up work is documented.
17
+
18
+ ## Phase Execution Matrix
19
+
20
+ | Phase # | Phase Title | Spec Path | Output Path | Status |
21
+ |---|---|---|---|---|
22
+ {{phaseMatrix}}
@@ -0,0 +1,28 @@
1
+ # Antigravity Workspace Rules — PlanKit Integration
2
+
3
+ Whenever working in this workspace, follow the PlanKit Command Suite defined in `{{artifactsDir}}/PLANKIT.md`.
4
+
5
+ ## Commands
6
+
7
+ ### `plankit.plan` [feature-description]
8
+
9
+ - Create `{{artifactsDir}}/current/<feature-name>/`.
10
+ - Create `README.md` with overview, progress table, DoD checklist, and status matrix.
11
+ - Create phase specs in `phases/phase-N-*.md`.
12
+
13
+ ### `plankit.clarify`
14
+
15
+ - Read the feature `README.md` and target phase spec.
16
+ - Inspect relevant codebase files.
17
+ - Ask structured clarifying questions before modifying code.
18
+
19
+ ### `plankit.implement` [phase]
20
+
21
+ - Read `phases/phase-N-*.md` and all previous `outputs/phase-*-output.md`.
22
+ - Execute changes, run tests where appropriate, write `outputs/phase-N-output.md`, and update `README.md`.
23
+
24
+ ### `plankit.review`
25
+
26
+ - Run configured verification commands.
27
+ - Validate Definition of Done.
28
+ - Archive the completed feature.
@@ -0,0 +1,10 @@
1
+ ---
2
+ description: Analyze requirements and codebase before executing code edits.
3
+ ---
4
+
5
+ Analyze requirements and clarify design decisions according to PlanKit.
6
+
7
+ 1. Read `{{artifactsDir}}/current/<feature-name>/README.md` and target spec in `phases/`.
8
+ 2. Inspect relevant codebase files.
9
+ 3. Present targeted clarifying questions about design choices, API contracts, or edge cases.
10
+ 4. Do not make code changes until required clarifications are resolved.
@@ -0,0 +1,14 @@
1
+ ---
2
+ description: Execute Phase N by reading phase spec and all previous outputs.
3
+ ---
4
+
5
+ Execute a feature phase according to PlanKit.
6
+
7
+ Phase to implement: $ARG
8
+
9
+ 1. Read target phase spec under `{{artifactsDir}}/current/<feature-name>/phases/`.
10
+ 2. Read all previous output reports from `outputs/`.
11
+ 3. Execute scoped code and configuration changes.
12
+ 4. Run relevant verification commands.
13
+ 5. Write execution report to `outputs/phase-N-output.md`.
14
+ 6. Update the feature `README.md`.
@@ -0,0 +1,13 @@
1
+ ---
2
+ description: Initialize a new feature under {{artifactsDir}}/current/<feature-name>/.
3
+ ---
4
+
5
+ Initialize a new feature in the workspace according to PlanKit.
6
+
7
+ Requirements: $ARG
8
+
9
+ Steps:
10
+ 1. Create `{{artifactsDir}}/current/<feature-name>/`.
11
+ 2. Create `README.md` with overview, architecture notes, DoD checklist, and progress matrix.
12
+ 3. Write phase specification files under `phases/phase-N-<step-name>.md`.
13
+ 4. Present Phase 1 implementation plan and request approval when required.
@@ -0,0 +1,11 @@
1
+ ---
2
+ description: Run verification, validate DoD, and archive a completed feature.
3
+ ---
4
+
5
+ Verify a completed feature and archive it according to PlanKit.
6
+
7
+ 1. Run configured test and build commands.
8
+ 2. Validate Definition of Done checklist items in the feature `README.md`.
9
+ 3. Update the feature title to indicate archive state.
10
+ 4. Move the feature directory from `{{artifactsDir}}/current/` to `{{artifactsDir}}/archived/`.
11
+ 5. Present final completion summary.
@@ -0,0 +1,12 @@
1
+ ---
2
+ description: PlanKit Command Suite master command.
3
+ ---
4
+
5
+ Sub-action / Arguments: $ARG
6
+
7
+ Evaluate the sub-action:
8
+
9
+ - `plan`: initialize a feature under `{{artifactsDir}}/current/<feature-name>/`.
10
+ - `clarify`: inspect codebase and specs, then ask structured clarifying questions.
11
+ - `implement`: read target spec and previous outputs, execute changes, write phase output, and update README.
12
+ - `review`: run verification, validate DoD, and archive completed feature work.
@@ -0,0 +1,17 @@
1
+ # Phase {{phaseNumber}} Output: {{phaseTitle}}
2
+
3
+ ## Summary
4
+
5
+ Pending implementation summary.
6
+
7
+ ## Changes Made
8
+
9
+ - Pending.
10
+
11
+ ## Verification
12
+
13
+ - Pending.
14
+
15
+ ## Follow-ups
16
+
17
+ - Pending.
@@ -0,0 +1,19 @@
1
+ # Phase {{phaseNumber}}: {{phaseTitle}}
2
+
3
+ ## 1. Objective
4
+
5
+ {{objective}}
6
+
7
+ ## 2. Tasks
8
+
9
+ {{tasks}}
10
+
11
+ ## 3. Inputs
12
+
13
+ - Feature README: `../README.md`
14
+ - Previous outputs: `../outputs/phase-1-output.md` through `../outputs/phase-{{previousPhaseNumber}}-output.md`, when applicable.
15
+
16
+ ## 4. Expected Output
17
+
18
+ - Implementation changes scoped to this phase.
19
+ - Output report: `../outputs/phase-{{phaseNumber}}-output.md`