@context-forge/core 0.6.7 → 0.6.9

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.
@@ -1 +1 @@
1
- {"version":3,"file":"ConfigKeys.d.ts","sourceRoot":"","sources":["../../src/config/ConfigKeys.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,QAAQ,GAAG,SAAS,GAAG,QAAQ,CAAC;IACtC,OAAO,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;CAChE;AAED,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAgC3D,CAAC"}
1
+ {"version":3,"file":"ConfigKeys.d.ts","sourceRoot":"","sources":["../../src/config/ConfigKeys.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,QAAQ,GAAG,SAAS,GAAG,QAAQ,CAAC;IACtC,OAAO,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;CAChE;AAED,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,CA2B3D,CAAC"}
@@ -1,9 +1,4 @@
1
1
  export const CONFIG_KEYS = {
2
- default_project: {
3
- type: 'string',
4
- default: '',
5
- description: 'Default project ID used when projectId is not provided to MCP tools',
6
- },
7
2
  'guide.auto_update': {
8
3
  type: 'boolean',
9
4
  default: false,
@@ -1 +1 @@
1
- {"version":3,"file":"ConfigKeys.js","sourceRoot":"","sources":["../../src/config/ConfigKeys.ts"],"names":[],"mappings":"AAQA,MAAM,CAAC,MAAM,WAAW,GAAwC;IAC9D,eAAe,EAAE;QACf,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,qEAAqE;KACnF;IACD,mBAAmB,EAAE;QACnB,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,KAAK;QACd,WAAW,EAAE,sDAAsD;KACpE;IACD,cAAc,EAAE;QACd,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,4CAA4C;KAC1D;IACD,oBAAoB,EAAE;QACpB,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,WAAW;QACpB,WAAW,EAAE,oDAAoD;QACjE,IAAI,EAAE,CAAC,WAAW,EAAE,OAAO,EAAE,QAAQ,CAAC;KACvC;IACD,uBAAuB,EAAE;QACvB,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,KAAK;QACd,WAAW,EAAE,qDAAqD;KACnE;IACD,mBAAmB,EAAE;QACnB,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,KAAK;QACd,WAAW,EAAE,iFAAiF;KAC/F;CACF,CAAC"}
1
+ {"version":3,"file":"ConfigKeys.js","sourceRoot":"","sources":["../../src/config/ConfigKeys.ts"],"names":[],"mappings":"AAQA,MAAM,CAAC,MAAM,WAAW,GAAwC;IAC9D,mBAAmB,EAAE;QACnB,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,KAAK;QACd,WAAW,EAAE,sDAAsD;KACpE;IACD,cAAc,EAAE;QACd,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,4CAA4C;KAC1D;IACD,oBAAoB,EAAE;QACpB,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,WAAW;QACpB,WAAW,EAAE,oDAAoD;QACjE,IAAI,EAAE,CAAC,WAAW,EAAE,OAAO,EAAE,QAAQ,CAAC;KACvC;IACD,uBAAuB,EAAE;QACvB,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,KAAK;QACd,WAAW,EAAE,qDAAqD;KACnE;IACD,mBAAmB,EAAE;QACnB,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,KAAK;QACd,WAAW,EAAE,iFAAiF;KAC/F;CACF,CAAC"}
@@ -8,12 +8,15 @@ export declare class GuideDetector {
8
8
  * Detect guide installation state for a project.
9
9
  * @param projectPath - absolute path to the project root
10
10
  * @param source - override source URL (defaults to DEFAULT_SOURCE_GIT)
11
+ * @param operationPath - worktree path for filesystem checks (defaults to projectPath)
11
12
  */
12
- detect(projectPath: string, source?: string): Promise<GuideInfo>;
13
+ detect(projectPath: string, source?: string, operationPath?: string): Promise<GuideInfo>;
13
14
  /** Determine installation method by inspecting filesystem */
14
15
  private detectMethod;
15
16
  /** Detect current version based on method */
16
17
  private detectVersion;
18
+ /** Check whether a worktree's submodule checkout is in sync with the committed pointer */
19
+ checkSyncStatus(worktreePath: string): Promise<'in_sync' | 'out_of_sync' | 'not_initialized' | 'error'>;
17
20
  /** Fetch latest version from remote. Returns null on any failure. */
18
21
  private fetchLatestVersion;
19
22
  }
@@ -1 +1 @@
1
- {"version":3,"file":"GuideDetector.d.ts","sourceRoot":"","sources":["../../src/guides/GuideDetector.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,SAAS,EAKf,MAAM,YAAY,CAAC;AAiCpB;;GAEG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CASrF;AAED,qBAAa,aAAa;IACxB;;;;OAIG;IACG,MAAM,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC;IAuCtE,6DAA6D;IAC7D,OAAO,CAAC,YAAY;IAuBpB,6CAA6C;YAC/B,aAAa;IAmB3B,qEAAqE;YACvD,kBAAkB;CAWjC"}
1
+ {"version":3,"file":"GuideDetector.d.ts","sourceRoot":"","sources":["../../src/guides/GuideDetector.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,SAAS,EAKf,MAAM,YAAY,CAAC;AAiCpB;;GAEG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CASrF;AAED,qBAAa,aAAa;IACxB;;;;;OAKG;IACG,MAAM,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC;IAwC9F,6DAA6D;IAC7D,OAAO,CAAC,YAAY;IAuBpB,6CAA6C;YAC/B,aAAa;IAmB3B,0FAA0F;IACpF,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,GAAG,aAAa,GAAG,iBAAiB,GAAG,OAAO,CAAC;IAe7G,qEAAqE;YACvD,kBAAkB;CAWjC"}
@@ -51,10 +51,12 @@ export class GuideDetector {
51
51
  * Detect guide installation state for a project.
52
52
  * @param projectPath - absolute path to the project root
53
53
  * @param source - override source URL (defaults to DEFAULT_SOURCE_GIT)
54
+ * @param operationPath - worktree path for filesystem checks (defaults to projectPath)
54
55
  */
55
- async detect(projectPath, source) {
56
+ async detect(projectPath, source, operationPath) {
56
57
  const resolvedSource = source || DEFAULT_SOURCE_GIT;
57
- const guidePath = join(projectPath, GUIDE_RELATIVE_PATH);
58
+ const effectivePath = operationPath || projectPath;
59
+ const guidePath = join(effectivePath, GUIDE_RELATIVE_PATH);
58
60
  const baseInfo = {
59
61
  installed: false,
60
62
  method: null,
@@ -70,7 +72,7 @@ export class GuideDetector {
70
72
  baseInfo.latestVersion = await this.fetchLatestVersion(resolvedSource);
71
73
  return baseInfo;
72
74
  }
73
- // Guide directory exists — determine method
75
+ // Guide directory exists — determine method (use projectPath for .gitmodules check)
74
76
  const method = this.detectMethod(projectPath, guidePath);
75
77
  const version = await this.detectVersion(guidePath, method);
76
78
  const latestVersion = await this.fetchLatestVersion(resolvedSource);
@@ -128,6 +130,21 @@ export class GuideDetector {
128
130
  return null;
129
131
  }
130
132
  }
133
+ /** Check whether a worktree's submodule checkout is in sync with the committed pointer */
134
+ async checkSyncStatus(worktreePath) {
135
+ try {
136
+ const { stdout } = await gitExec(['submodule', 'status', GUIDE_RELATIVE_PATH], worktreePath);
137
+ const trimmed = stdout.trimStart();
138
+ if (trimmed.startsWith('+'))
139
+ return 'out_of_sync';
140
+ if (trimmed.startsWith('-'))
141
+ return 'not_initialized';
142
+ return 'in_sync';
143
+ }
144
+ catch {
145
+ return 'error';
146
+ }
147
+ }
131
148
  /** Fetch latest version from remote. Returns null on any failure. */
132
149
  async fetchLatestVersion(source) {
133
150
  try {
@@ -1 +1 @@
1
- {"version":3,"file":"GuideDetector.js","sourceRoot":"","sources":["../../src/guides/GuideDetector.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAGL,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC;;;GAGG;AACH,SAAS,eAAe,CAAC,cAAsB;IAC7C,MAAM,UAAU,GAAG,gCAAgC,CAAC;IACpD,MAAM,IAAI,GAAa,EAAE,CAAC;IAE1B,KAAK,MAAM,IAAI,IAAI,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;QAC9C,MAAM,KAAK,GAAG,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;QAC3C,IAAI,KAAK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@
1
1
  import type { ConfigManager } from '../config/ConfigManager.js';
2
- import type { GuideInfo, GuideMethod, InstallResult, UpdateResult } from './types.js';
2
+ import type { GuideInfo, GuideMethod, InstallResult, UpdateResult, SyncResult } from './types.js';
3
3
  export declare class GuideManager {
4
4
  private readonly projectPath;
5
5
  private readonly configManager?;
6
6
  private readonly detector;
7
- constructor(projectPath: string, configManager?: ConfigManager);
7
+ private readonly operationPath?;
8
+ constructor(projectPath: string, configManager?: ConfigManager, operationPath?: string);
8
9
  /** Get current guide installation status */
9
10
  status(): Promise<GuideInfo>;
10
11
  /** Install the guide into the project */
11
12
  install(strategyOverride?: GuideMethod, sourceOverride?: string): Promise<InstallResult>;
12
13
  /** Update an existing guide installation */
13
14
  update(): Promise<UpdateResult>;
15
+ /** Sync guide submodule checkout in multiple worktrees */
16
+ syncWorktrees(worktreePaths: string[]): Promise<SyncResult[]>;
14
17
  /** Resolve source URL from config or default */
15
18
  private resolveSource;
16
19
  /** Resolve strategy from config or default */
@@ -1 +1 @@
1
- {"version":3,"file":"GuideManager.d.ts","sourceRoot":"","sources":["../../src/guides/GuideManager.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,aAAa,EAAE,YAAY,EAAmB,MAAM,YAAY,CAAC;AAOvG,qBAAa,YAAY;IACvB,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAS;IACrC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAgB;IAC/C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAgB;gBAE7B,WAAW,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,aAAa;IAM9D,4CAA4C;IACtC,MAAM,IAAI,OAAO,CAAC,SAAS,CAAC;IAKlC,yCAAyC;IACnC,OAAO,CAAC,gBAAgB,CAAC,EAAE,WAAW,EAAE,cAAc,CAAC,EAAE,MAAM,GAAG,OAAO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AW;CAUpB"}
@@ -10,15 +10,17 @@ export class GuideManager {
10
10
  projectPath;
11
11
  configManager;
12
12
  detector;
13
- constructor(projectPath, configManager) {
13
+ operationPath;
14
+ constructor(projectPath, configManager, operationPath) {
14
15
  this.projectPath = projectPath;
15
16
  this.configManager = configManager;
16
17
  this.detector = new GuideDetector();
18
+ this.operationPath = operationPath;
17
19
  }
18
20
  /** Get current guide installation status */
19
21
  async status() {
20
22
  const source = await this.resolveSource();
21
- return this.detector.detect(this.projectPath, source);
23
+ return this.detector.detect(this.projectPath, source, this.operationPath);
22
24
  }
23
25
  /** Install the guide into the project */
24
26
  async install(strategyOverride, sourceOverride) {
@@ -45,7 +47,36 @@ export class GuideManager {
45
47
  throw new Error('Guide is not installed. Use guide_install (or cf guides install) to install it first.');
46
48
  }
47
49
  const strategy = this.getStrategy(info.method);
48
- return strategy.update(this.projectPath, targetDir);
50
+ const result = await strategy.update(this.projectPath, targetDir);
51
+ // Sync the worktree's submodule checkout if operating from a non-default worktree
52
+ if (this.operationPath && this.operationPath !== this.projectPath && info.method === 'submodule') {
53
+ const submoduleStrategy = strategy;
54
+ await submoduleStrategy.sync(this.operationPath, this.projectPath);
55
+ }
56
+ return result;
57
+ }
58
+ /** Sync guide submodule checkout in multiple worktrees */
59
+ async syncWorktrees(worktreePaths) {
60
+ const source = await this.resolveSource();
61
+ const info = await this.detector.detect(this.projectPath, source);
62
+ if (info.method !== 'submodule')
63
+ return [];
64
+ const strategy = new SubmoduleStrategy();
65
+ const results = [];
66
+ for (const worktreePath of worktreePaths) {
67
+ try {
68
+ await strategy.sync(worktreePath, this.projectPath);
69
+ results.push({ worktreePath, success: true });
70
+ }
71
+ catch (err) {
72
+ results.push({
73
+ worktreePath,
74
+ success: false,
75
+ error: err instanceof Error ? err.message : String(err),
76
+ });
77
+ }
78
+ }
79
+ return results;
49
80
  }
50
81
  /** Resolve source URL from config or default */
51
82
  async resolveSource() {
@@ -1 +1 @@
1
- {"version":3,"file":"GuideManager.js","sour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AAW,EAAE,GAAG,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAC9D,CAAC;IACH,CAAC;IAED,2CAA2C;IACnC,WAAW,CAAC,MAAmB;QACrC,QAAQ,MAAM,EAAE,CAAC;YACf,KAAK,WAAW;gBACd,OAAO,IAAI,iBAAiB,EAAE,CAAC;YACjC,KAAK,OAAO;gBACV,OAAO,IAAI,aAAa,EAAE,CAAC;YAC7B,KAAK,QAAQ;gBACX,OAAO,IAAI,eAAe,EAAE,CAAC;QACjC,CAAC;IACH,CAAC;CACF"}
@@ -3,5 +3,12 @@ export declare class SubmoduleStrategy implements InstallStrategy {
3
3
  detect(projectPath: string, targetDir: string): Promise<DetectionResult | null>;
4
4
  install(projectPath: string, source: string, targetDir: string): Promise<InstallResult>;
5
5
  update(projectPath: string, targetDir: string): Promise<UpdateResult>;
6
+ /**
7
+ * Sync a worktree's submodule checkout to match the primary worktree's pointer.
8
+ * Reads the target commit from projectPath's HEAD, then checks it out in the
9
+ * worktree's guide directory. This handles worktrees on different branches
10
+ * where `git submodule update` would only sync to the worktree's own index.
11
+ */
12
+ sync(worktreePath: string, projectPath: string): Promise<void>;
6
13
  }
7
14
  //# sourceMappingURL=SubmoduleStrategy.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SubmoduleStrategy.d.ts","sourceRoot":"","sources":["../../../src/guides/strategies/SubmoduleStrategy.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAIjG,qBAAa,iBAAkB,YAAW,eAAe;IACjD,MAAM,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC;IA2B/E,OAAO,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAkCvF,MAAM,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;CA+B5E"}
1
+ {"version":3,"file":"SubmoduleStrategy.d.ts","sourceRoot":"","sources":["../../../src/guides/strategies/SubmoduleStrategy.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAIjG,qBAAa,iBAAkB,YAAW,eAAe;IACjD,MAAM,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC;IA2B/E,OAAO,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAkCvF,MAAM,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IAgC3E;;;;;OAKG;IACG,IAAI,CAAC,YAAY,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAoBrE"}
@@ -80,5 +80,26 @@ export class SubmoduleStrategy {
80
80
  }
81
81
  return { success: true, previousVersion, newVersion, method: 'submodule' };
82
82
  }
83
+ /**
84
+ * Sync a worktree's submodule checkout to match the primary worktree's pointer.
85
+ * Reads the target commit from projectPath's HEAD, then checks it out in the
86
+ * worktree's guide directory. This handles worktrees on different branches
87
+ * where `git submodule update` would only sync to the worktree's own index.
88
+ */
89
+ async sync(worktreePath, projectPath) {
90
+ // Read target commit from primary worktree
91
+ const { stdout } = await gitExec(['ls-tree', 'HEAD', GUIDE_RELATIVE_PATH], projectPath);
92
+ const match = /^160000 commit ([0-9a-f]+)\t/.exec(stdout);
93
+ if (!match) {
94
+ throw new Error('Could not read submodule commit from project HEAD');
95
+ }
96
+ const targetCommit = match[1];
97
+ // Ensure submodule is initialized in the worktree
98
+ await gitExec(['submodule', 'update', '--init', GUIDE_RELATIVE_PATH], worktreePath);
99
+ // Fetch latest objects so the target commit is available, then checkout
100
+ const guidePath = join(worktreePath, GUIDE_RELATIVE_PATH);
101
+ await gitExec(['fetch', 'origin'], guidePath);
102
+ await gitExec(['checkout', targetCommit], guidePath);
103
+ }
83
104
  }
84
105
  //# sourceMappingURL=SubmoduleStrategy.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SubmoduleStrategy.js","sourceRoot":"","sources":["../../../src/guides/strategies/SubmoduleStrategy.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAC9C,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAEnE,MAAM,OAAO,iBAAiB;IAC5B,KAAK,CAAC,MAAM,CAAC,WAAmB,EAAE,SAAiB;QACjD,MAAM,cAAc,GAAG,IAAI,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC;QACxD,IAAI,CAAC,UAAU,CAAC,cAAc,CAAC;YAAE,OAAO,IAAI,CAAC;QAE7C,IAAI,CAAC;YACH,MAAM,OAAO,GAAG,YAAY,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;YACtD,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAC;gBAAE,OAAO,IAAI,CAAC;YAExD,IAAI,OAAO,GAAkB,IAAI,CAAC;YAClC,IAAI,CAAC;gBACH,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,OAAO,CAAC,CAAC,UAAU,EAAE,QAAQ,EAAE,YAAY,CAAC,EAAE,SAAS,CAAC,CAAC;gBAClF,OAAO,GAAG,MAAM,IAAI,IAAI,CA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,CAAC,CAAC,CAAC,EAAE,CAAC;YAC5D,MAAM,OAAO,CACX,CAAC,QAAQ,EAAE,IAAI,EAAE,gCAAgC,aAAa,EAAE,CAAC,EACjE,WAAW,CACZ,CAAC;QACJ,CAAC;QAED,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC;IAC7E,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,IAAI,CAAC,YAAoB,EAAE,WAAmB;QAClD,2CAA2C;QAC3C,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,OAAO,CAC9B,CAAC,SAAS,EAAE,MAAM,EAAE,mBAAmB,CAAC,EACxC,WAAW,CACZ,CAAC;QACF,MAAM,KAAK,GAAG,8BAA8B,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC1D,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;QACvE,CAAC;QACD,MAAM,YAAY,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QAE9B,kDAAkD;QAClD,MAAM,OAAO,CAAC,CAAC,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,mBAAmB,CAAC,EAAE,YAAY,CAAC,CAAC;QAEpF,wEAAwE;QACxE,MAAM,SAAS,GAAG,IAAI,CAAC,YAAY,EAAE,mBAAmB,CAAC,CAAC;QAC1D,MAAM,OAAO,CAAC,CAAC,OAAO,EAAE,QAAQ,CAAC,EAAE,SAAS,CAAC,CAAC;QAC9C,MAAM,OAAO,CAAC,CAAC,UAAU,EAAE,YAAY,CAAC,EAAE,SAAS,CAAC,CAAC;IACvD,CAAC;CACF"}
@@ -25,6 +25,12 @@ export interface UpdateResult {
25
25
  newVersion: string | null;
26
26
  method: GuideMethod;
27
27
  }
28
+ /** Result of syncing a worktree's guide submodule checkout */
29
+ export interface SyncResult {
30
+ worktreePath: string;
31
+ success: boolean;
32
+ error?: string;
33
+ }
28
34
  /** Detection result returned by a strategy's detect() method */
29
35
  export interface DetectionResult {
30
36
  method: GuideMethod;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/guides/types.ts"],"names":[],"mappings":"AAEA,wDAAwD;AACxD,MAAM,MAAM,WAAW,GAAG,WAAW,GAAG,OAAO,GAAG,QAAQ,CAAC;AAE3D,0CAA0C;AAC1C,MAAM,WAAW,SAAS;IACxB,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,EAAE,WAAW,GAAG,IAAI,CAAC;IAC3B,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,eAAe,EAAE,OAAO,CAAC;IACzB,kBAAkB,EAAE,OAAO,CAAC;CAC7B;AAED,qCAAqC;AACrC,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,MAAM,EAAE,WAAW,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,+BAA+B;AAC/B,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,MAAM,EAAE,WAAW,CAAC;CACrB;AAED,gEAAgE;AAChE,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,WAAW,CAAC;IACpB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAED,wDAAwD;AACxD,MAAM,WAAW,eAAe;IAC9B,OAAO,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,C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AW,CAAC;CACrB;AAED,8DAA8D;AAC9D,MAAM,WAAW,UAAU;IACzB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,gEAAgE;AAChE,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,WAAW,CAAC;IACpB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAED,wDAAwD;AACxD,MAAM,WAAW,eAAe;IAC9B,OAAO,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;IACxF,MAAM,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IACtE,MAAM,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,CAAC;CACjF;AAGD,eAAO,MAAM,kBAAkB,qDAAqD,CAAC;AACrF,eAAO,MAAM,kBAAkB,2DAA2D,CAAC;AAC3F,eAAO,MAAM,mBAAmB,uCAAuC,CAAC;AACxE,eAAO,MAAM,mBAAmB,iCAAiC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/guides/types.ts"],"names":[],"mappings":"AAAA,gDAAgD;AA+ChD,YAAY;AACZ,MAAM,CAAC,MAAM,kBAAkB,GAAG,kDAAkD,CAAC;AACrF,MAAM,CAAC,MAAM,kBAAkB,GAAG,wDAAwD,CAAC;AAC3F,MAAM,CAAC,MAAM,mBAAmB,GAAG,oCAAoC,CAAC;AACxE,MAAM,CAAC,MAAM,mBAAmB,GAAG,8BAA8B,CAAC"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/guides/types.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAsDhD,YAAY;AACZ,MAAM,CAAC,MAAM,kBAAkB,GAAG,kDAAkD,CAAC;AACrF,MAAM,CAAC,MAAM,kBAAkB,GAAG,wDAAwD,CAAC;AAC3F,MAAM,CAAC,MAAM,mBAAmB,GAAG,oCAAoC,CAAC;AACxE,MAAM,CAAC,MAAM,mBAAmB,GAAG,8BAA8B,CAAC"}
package/dist/index.d.ts CHANGED
@@ -2,7 +2,7 @@ export * from './types/index.js';
2
2
  export * from './services/index.js';
3
3
  export type { IProjectStore, IStorageService, StorageReadResult } from './storage/interfaces.js';
4
4
  export * from './introspection/index.js';
5
- export type { GuideInfo, GuideMethod, InstallResult, UpdateResult } from './guides/types.js';
5
+ export type { GuideInfo, GuideMethod, InstallResult, UpdateResult, SyncResult } from './guides/types.js';
6
6
  export * from './schema/projectSchema.js';
7
7
  export { GitWorktreeDiscovery, parseWorktreeListOutput } from './git/index.js';
8
8
  export { applyWorktreeOverlay } from './utils/worktree-overlay.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AAGpC,YAAY,EAAE,aAAa,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAGjG,cAAc,0BAA0B,CAAC;AAGzC,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAG7F,cAAc,2BAA2B,CAAC;AAG1C,OAAO,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAG/E,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AAGpC,YAAY,EAAE,aAAa,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAGjG,cAAc,0BAA0B,CAAC;AAGzC,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,aAAa,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAGzG,cAAc,2BAA2B,CAAC;AAG1C,OAAO,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAG/E,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC"}
@@ -1,17 +1,20 @@
1
1
  import { ContextTemplateEngine } from './ContextTemplateEngine.js';
2
2
  import { ContextIntegrator } from './ContextIntegrator.js';
3
3
  /**
4
- * Resolve the system prompt file path.
5
- * Prefers the project-local ai-project-guide copy; falls back to the bundled asset.
6
- * When called without a projectPath, returns the bundled asset directly.
4
+ * Resolve the system prompt file path for a project.
5
+ * Requires the project to have ai-project-guide installed.
6
+ * Throws if no prompt file is found.
7
+ *
8
+ * @param projectPath Absolute path to the project root
9
+ * @returns Absolute path to the prompt file
7
10
  */
8
- export declare function resolvePromptFilePath(projectPath?: string): string;
11
+ export declare function resolvePromptFilePath(projectPath: string): string;
9
12
  /**
10
13
  * Creates a fully wired context assembly pipeline for a given project path.
11
14
  * Intended for use in non-renderer contexts (MCP server, CLI, tests).
12
15
  *
13
- * Uses the project-local ai-project-guide prompt file if present,
14
- * otherwise falls back to the bundled prompt shipped with @context-forge/core.
16
+ * Uses the project-local ai-project-guide prompt file.
17
+ * Throws if the guide is not installed.
15
18
  *
16
19
  * @param projectPath Absolute path to the project root
17
20
  * @returns { engine, integrator } ready for context generation
@@ -1 +1 @@
1
- {"version":3,"file":"CoreServiceFactory.d.ts","sourceRoot":"","sources":["../../src/services/CoreServiceFactory.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAW3D;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAQlE;AAED;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,MAAM,GAAG;IAC1D,MAAM,EAAE,qBAAqB,CAAC;IAC9B,UAAU,EAAE,iBAAiB,CAAC;CAC/B,CAYA"}
1
+ {"version":3,"file":"CoreServiceFactory.d.ts","sourceRoot":"","sources":["../../src/services/CoreServiceFactory.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAG3D;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAQjE;AAED;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,MAAM,GAAG;IAC1D,MAAM,EAAE,qBAAqB,CAAC;IAC9B,UAAU,EAAE,iBAAiB,CAAC;CAC/B,CAYA"}
@@ -1,33 +1,31 @@
1
1
  import * as fs from 'fs';
2
2
  import * as path from 'path';
3
- import { fileURLToPath } from 'url';
4
3
  import { SystemPromptParser } from './SystemPromptParser.js';
5
4
  import { StatementManager } from './StatementManager.js';
6
5
  import { ContextTemplateEngine } from './ContextTemplateEngine.js';
7
6
  import { ContextIntegrator } from './ContextIntegrator.js';
8
7
  import { PROMPT_FILE_RELATIVE_PATH, STATEMENTS_FILE_RELATIVE_PATH } from './constants.js';
9
- /** Absolute path to the bundled system prompt file shipped with @context-forge/core */
10
- const BUNDLED_PROMPT_PATH = path.join(path.dirname(fileURLToPath(import.meta.url)), '..', 'assets', 'prompt.ai-project.system.md');
11
8
  /**
12
- * Resolve the system prompt file path.
13
- * Prefers the project-local ai-project-guide copy; falls back to the bundled asset.
14
- * When called without a projectPath, returns the bundled asset directly.
9
+ * Resolve the system prompt file path for a project.
10
+ * Requires the project to have ai-project-guide installed.
11
+ * Throws if no prompt file is found.
12
+ *
13
+ * @param projectPath Absolute path to the project root
14
+ * @returns Absolute path to the prompt file
15
15
  */
16
16
  export function resolvePromptFilePath(projectPath) {
17
- if (projectPath) {
18
- const projectLocalPath = path.join(projectPath, PROMPT_FILE_RELATIVE_PATH);
19
- if (fs.existsSync(projectLocalPath)) {
20
- return projectLocalPath;
21
- }
17
+ const projectLocalPath = path.join(projectPath, PROMPT_FILE_RELATIVE_PATH);
18
+ if (fs.existsSync(projectLocalPath)) {
19
+ return projectLocalPath;
22
20
  }
23
- return BUNDLED_PROMPT_PATH;
21
+ throw new Error(`No prompt file found at ${projectLocalPath}. Run 'cf guide install' to set up the AI project guide.`);
24
22
  }
25
23
  /**
26
24
  * Creates a fully wired context assembly pipeline for a given project path.
27
25
  * Intended for use in non-renderer contexts (MCP server, CLI, tests).
28
26
  *
29
- * Uses the project-local ai-project-guide prompt file if present,
30
- * otherwise falls back to the bundled prompt shipped with @context-forge/core.
27
+ * Uses the project-local ai-project-guide prompt file.
28
+ * Throws if the guide is not installed.
31
29
  *
32
30
  * @param projectPath Absolute path to the project root
33
31
  * @returns { engine, integrator } ready for context generation
@@ -1 +1 @@
1
- {"version":3,"file":"CoreServiceFactory.js","sourceRoot":"","sources":["../../src/services/CoreServiceFactory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,yBAAyB,EAAE,6BAA6B,EAAE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AY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IACpF,MAAM,UAAU,GAAG,IAAI,iBAAiB,CAAC,MAAM,EAAE,IAAI,EAAE,UAAU,CAAC,CAAC;IAEnE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC;AAChC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@context-forge/core",
3
- "version": "0.6.7",
3
+ "version": "0.6.9",
4
4
  "description": "Core context generation engine for Context Forge — template processing, project state, prompt assembly",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -1,787 +0,0 @@
1
- ---
2
- layer: snippet
3
- docType: template
4
- purpose: reusable-llm-prompts
5
- audience:
6
- - human
7
- - ai
8
- ai description: Parameterized prompt library mapped to slice-based project phases.
9
- dependsOn:
10
- - guide.ai-project.000-process.md
11
- npmScriptsAiSupport: "!include ../snippets/npm-scripts.ai-support.json"
12
- dateCreated: 20250724
13
- dateUpdated: 20260302
14
- ---
15
- ## Prompts
16
- This document contains prepared prompts useful in applying the `guide.ai-project.000-process` and performing additional supplemental tasks.
17
-
18
- ### Context Profiles
19
- Maps prompt templates to their required context documents.
20
- Variables not listed are excluded from context assembly.
21
- Order: concept → hld → spec → arch → plan → slice → tasks. Note that not all inputs may be or are required to be present (we frequently do not have fileHLD or fileSpec, for example). This table is an interrim solution before we split the monolitic prompt file, which should happen soon.
22
- ```yaml
23
- context_profiles:
24
- concept-phase-1: []
25
- architecture-phase-2: [fileConcept, fileHLD, fileSpec, fileArch]
26
- slice-planning-phase-3: [fileArch, fileSlicePlan]
27
- slice-design-phase-4: [fileArch, fileSlicePlan, fileSlice]
28
- task-breakdown-phase-5: [fileSlicePlan, fileSlice, fileTasks]
29
- implementation-phase-6: [fileSlice, fileTasks]
30
- slice-integration-phase-7: [fileArch, fileSlicePlan, fileSlice, fileTasks]
31
- task-breakdown-supplement-phase-5: [fileSlicePlan, fileSlice, fileTasks]
32
- task-expansion-variant-phase-5: [fileSlicePlan, fileSlice, fileTasks]
33
- context-initialization: []
34
- maintenance-task: [fileTasks]
35
- maintenance-routine: [fileSlice, fileTasks]
36
- analysis-processing: [fileSlice, fileTasks]
37
- analysis-task-creation: [fileTasks]
38
- analysis-to-lld: [fileSlice]
39
- analysis-task-implementation: [fileSlice, fileTasks]
40
- analyze-codebase: []
41
- custom-instruction: []
42
- _default: [fileArch, fileSlicePlan, fileSlice, fileTasks]
43
- ```
44
-
45
- ##### Concept (Phase 1)
46
- ```markdown
47
- We're starting work on a new project {project}. We will use our curated AI Project Creation methods in `guide.ai-project.000-process` (can also be referred to as Project Guide or Process Guide) to assist us in designing and performing the work. Your role as described in the Project Guide is Architect.
48
-
49
- Our goal is to collaboratively create the concept document. The Project Manager will describe the project — usually conversationally, though they may also provide a starter document in `user/project-guides/001-concept.{project}.md`. Either approach works; follow the PM's lead.
50
-
51
- Through conversation, refine the PM's vision into a concept document following the Living Document Pattern and the structure described in `guide.ai-project.001-concept`. The PM's original concept is preserved in the User-Provided Concept section; structured technical analysis goes into the Refined Concept section.
52
-
53
- We will use the completed concept as a basis for architecture and subsequent design work — breaking the project into architectural components, slice plans, and tasks.
54
-
55
- When creating the concept, *ask questions* if any information is missing or unclear. The guideline of do not assume or guess applies, but is even more important here at this early concept stage where misunderstandings compound through later phases. Request any needed clarifications from the Project Manager.
56
- ```
57
-
58
- ##### Architecture (Phase 2)
59
- *Use this to design a high-level architectural component or initiative that will span multiple slices. This is the most common entry point for work on existing projects.*
60
-
61
- ```markdown
62
- We're designing a new architectural component for project {project}. Architectural components represent major structural elements or new subsystems that will likely result in multiple slices and many tasks. This is distinct from individual slices—it's about the foundational architecture that slices will build upon.
63
-
64
- All projects will have at least one architectural component. A small project may have only one, and will directly reference the concept document to create its architectural component. In most projects, the project manager will describe the concept being designed in the architectural component.
65
-
66
- {{#if worktreeName}}
67
- **Worktree context:** You are working in the `{{worktreeName}}` worktree (index range {{worktreeRange}}).
68
- - Base index for this component's architecture document: {{worktreeIndexStart}}
69
- - Architecture file naming: `{{worktreeIndexStart}}-arch.<component-name>.md`
70
- - Current arch doc: `{{arch}}` (empty means none set yet — create one at index {{worktreeIndexStart}})
71
- {{else}}
72
- **Before proceeding, determine the component name and base index:**
73
- 1. If the project's `fileArch` is already set, use that component name and index.
74
- 2. If Additional Instructions below describe the component, derive the name from that description.
75
- 3. Otherwise, **stop and ask the Project Manager** what architectural component they want to create. Do not proceed with placeholder names.
76
-
77
- **To determine the base index:**
78
- - Scan `user/architecture/` for existing `nnn-arch.*.md` files to find the highest index in use.
79
- - The next available index is the next multiple of 10 (e.g., if `200-arch.*.md` exists, use `210`).
80
- - Valid range: 100–799 (initiative working range per `file-naming-conventions.md`).
81
- - Do not use 050–099 — that is reserved for project-level architecture (HLD).
82
-
83
- This base index will be shared by the slice plan and slice designs derived from this architecture document (e.g., if this document is `120-arch.name.md`, its slice plan will be `120-slices.name.md` and its first slice design will be `121-slice.first-slice.md`).
84
- {{/if}}
85
-
86
- Create the design document for the architectural component.
87
-
88
- Your role is Architect as described in the Process Guide. Keep this document at the architectural level—do not include task-level breakdown or detailed slice specifications.
89
-
90
- **Document Structure**
91
- The component design should include:
92
-
93
- 1. YAML Frontmatter
94
- ```
95
- ```yaml
96
- ---
97
- docType: architecture
98
- layer: project
99
- project: {project}
100
- archIndex: nnn
101
- component: component-name
102
- relatedSlices: []
103
- riskLevel: low|medium|high
104
- dateCreated: YYYYMMDD
105
- dateUpdated: YYYYMMDD
106
- ---
107
- ```
108
- ```markdown
109
- 2. Content Sections
110
- **Overview**
111
- - High-level description of the architectural component or initiative
112
- - State the core problem it addresses and why it matters to the project
113
- - Scope: Short paragraph on what this component encompasses
114
- - Motivation: Brief explanation of why this architectural change/component is needed
115
-
116
- **Design Goals**
117
- - List primary design goals (max: ~5) for this component (outcomes-oriented, not implementation-specific)
118
- - Format as bulleted list of short paragraphs with goal name and brief description
119
-
120
- **Architectural Principles**
121
- - Key principles that will guide the design of slices and tasks within this component
122
- - These inform how work should be structured, not what work to do
123
- - Format as bulleted list with principle name and brief description
124
-
125
- **Current State**
126
- Brief description of the current architecture or state that necessitates this design work
127
- What constraints or problems does the current system have?
128
-
129
- **Envisioned State**
130
- How this component will function at completion
131
- Focus on the role it plays in the larger system, not implementation details
132
- Describe the architecture from a system perspective, not from user perspective
133
-
134
- **Technical Considerations**
135
- Key technical challenges, trade-offs, or decisions that will inform slice design
136
- Format as bulleted list with consideration title and explanation
137
- These are constraints/challenges to be addressed, not proposed solutions
138
-
139
- **Anticipated Slices (optional)**
140
- At a high level, what slices do we expect this component might decompose into?
141
- This is exploratory—not a commitment or task list
142
- Format as bulleted list with provisional slice concept and brief description
143
- Include only if you have meaningful ideas about slice boundaries
144
-
145
- **Related Work**
146
- Reference to related slices, initiatives, or domain knowledge (if any exist)
147
- Link to existing architectural component, files, slice files, or framework guides
148
- No direct references to individual tasks
149
-
150
- 3. Guidelines
151
- - Keep it high-level: This document informs slice planning, not implementation. Do not include code, pseudo-code, or detailed API specifications.
152
- - Focus on architecture: Describe structural decisions and principles, not individual user-facing behaviors.
153
- - Avoid implementation detail: Do not prescribe how tasks will be organized or which technologies to use. That emerges during slice design.
154
- - Link to context: Reference existing slices or framework guides where relevant. Do not reference individual tasks.
155
- - Be concrete about principles: Architectural principles should be clear enough to guide slice designers. Avoid vague statements.
156
-
157
- **Expected Output**
158
- * Concise architectural component design document in `user/architecture/nnn-arch.component-name.md`
159
- * Create if it doesn't already exist. If file exists, edit existing file as described above.
160
- * Include all required YAML frontmatter
161
- * Preserve any Project Manager-provided context or requirements
162
- * Register the document: `cf set arch <nnn>` (e.g., `cf set arch 120`)
163
-
164
- Follow dependency management—identify what foundation work or other architectural components this initiative depends on or affects.
165
-
166
- Avoid:
167
- - Vague fluff about future performance testing or involved benchmarking unless specifically relevant
168
- - Speculative risk items; include only if truly relevant
169
- - Time estimates in any form
170
- - Task-level breakdown (that's slice planning's job)
171
- - Code examples unless absolutely essential to convey architectural meaning
172
-
173
- If you need more information about the component requirements or architectural constraints, stop and request clarification from the Project Manager.
174
-
175
- Note: This is a design and planning task, not a coding task. Any code samples should be minimal and limited to what is truly needed to convey architectural information.
176
- ```
177
-
178
- ##### Slice Planning (Phase 3)
179
- ```markdown
180
- We're working in our guide.ai-project.000-process, Phase 3: Slice Planning. Use `guide.ai-project.003-slice-planning` to break the work described in the parent document into manageable vertical slices.
181
-
182
- **Parent document**
183
- 1. Architecture document (`user/architecture/nnn-arch.{name}.md`) — for architecture-level planning
184
-
185
- Your role is Architect as described in the Process Guide. Work with the Project Manager to:
186
-
187
- 1. Identify the planning context (architecture-level) per the guide
188
- 2. Identify foundation work, functional slices, migration/refactoring slices, and integration work as applicable
189
- 3. Create the slice plan document in the correct location:
190
- `user/architecture/nnn-slices.{name}.md` (sharing the parent architecture document's base index, per `file-naming-conventions.md`)
191
- 4. When numbering slices, you may use an index starting with 1, but continue the same index throughout the document. Do not restart the numbering within the plan.
192
- 5. When naming slices in the slice plan, avoid use of ampersand or other special characters not commonly accepted in filenames. - and space are fine. Include a tentative slice number starting with the sliceplan index. Example: 1. [ ] **(100) MCP Server Scaffolding** - {remainder of entry}
193
- 6. Include YAML frontmatter with `status: active` (or `complete` if all slices are done).
194
-
195
- **Example YAML FrontMatter**:
196
- ```yaml
197
- ---
198
- docType: slice-plan
199
- parent: user/architecture/140-arch.context-forge-restructure.md
200
- project: context-forge
201
- dateCreated: 20260214
202
- dateUpdated: 20260217
203
- status: not_started
204
- ---
205
- ```
206
-
207
- ```markdown
208
- Use enough slices to completely define the scope of the parent document. Consider functional requirements only. Ignore non-functional requirements. Avoid speculative risk projections. Do not include calendar or time-based estimates.
209
-
210
- When defining slices, focus on slice independence and clear value delivery (user value, developer value, or architectural enablement). Each slice must leave the system in a working state when complete. If you have all required inputs and sufficient information, proceed with slice planning. If not, request required information from the Project Manager.
211
-
212
- Note: This is a design and planning task, not a coding task.
213
- ```
214
-
215
- ##### Slice Design (Phase 4)
216
- ```markdown
217
- We're working in our guide.ai-project.000-process, Phase 4: Slice Design (Low-Level Design). Create a detailed design for slice: {slice} in project {project} by following `guide.ai-project.004-slice-design`.
218
-
219
- **Inputs** (two levels — use what applies):
220
-
221
- *Strategic context* (provides the big-picture view of where this slice fits):
222
- - Architecture document or HLD — as identified by the Project Manager or referenced in the slice plan's parent document.
223
-
224
- *Working input* (defines what this specific slice should accomplish:
225
- 1. Slice plan entry from `user/architecture/nnn-slices.{name}.md`
226
- 2. Slice description provided directly with this request
227
-
228
- If using a slice plan, it must contain an entry for this slice. If the strategic context document is not obvious, ask the Project Manager.
229
-
230
- Create the slice design document at `user/slices/nnn-slice.{slice-name}.md`, where `nnn` shares the initiative's base index (for the first slice) or increments sequentially from it (for subsequent slices), per `file-naming-conventions.md`.
231
-
232
- When creating a slice design for a slice plan entry, update its entry to include the materialized `nnn` index.
233
- Example:
234
- Creating slice 175 for slice plan entry 11:
235
- pre: 11 [ ] **Our Slice Title** {slice plan entry text}
236
- post: 11 [ ] **(175) Our Slice Title** {slice plan entry text}
237
-
238
- Your role is Architect.
239
-
240
- Include:
241
- - YAML frontmatter as described below. Ensure that status field is present.
242
- - Detailed technical decisions for this slice
243
- - Data flows and component interactions
244
- - For migration/refactoring slices: migration plan (source/destination, consumer updates, behavior verification)
245
- - UI mockups or API/tool specifications (if applicable)
246
- - Cross-slice dependencies and interfaces
247
- - Success criteria specific enough for task creation
248
- - Verification walkthrough: concrete commands, workflows, and step-by-step confirmation that the user can follow to prove the slice delivers what it claims. This is not a restatement of success criteria — it's the "demo script" showing what the user can actually do. This is the draft walkthrough that will be refined when Phase 6 (Implementation) is complete.
249
- - Only template sections that are relevant to this slice — omit sections that don't apply
250
-
251
- Avoid:
252
- - Time estimates in hours/days/etc. You may use a 1-5 relative effort scale.
253
- - Extensive benchmarking tasks unless actually relevant to this effort.
254
- - Extensive or speculative risk items. Include only if truly relevant.
255
- - Any substantial code writing. This is a planning and process task.
256
- - Filling in template sections with boilerplate just because they exist.
257
-
258
- YAML Frontmatter:
259
- ```
260
- ```yaml
261
- ---
262
- docType: slice-design
263
- slice: {slice-name}
264
- project: {project}
265
- parent: {path to the slice plan this slice comes from}
266
- dependencies: [list-if-any]
267
- interfaces: [list-of-slices-that-depend-on-this]
268
- dateCreated: YYYYMMDD
269
- dateUpdated: YYYYMMDD
270
- status: not_started
271
- ---
272
- ```
273
- ```markdown
274
- If framework or platform are specified, guide(s) for the framework(s) should be provided in `ai-project-guide/framework-guides/{framework}/introduction.md`. If tools are specified, guide for each tool should be available at `ai-project-guide/tool-guides/{tool}/introduction.md`.
275
-
276
- Stop and request clarification if you need more information to complete the slice design. This is a design and process task — not a coding task! Any code present should be minimal, and should provide essential information.
277
- ```
278
-
279
- ##### Task Breakdown (Phase 5)
280
- ```markdown
281
- We're working in our guide.ai-project.000-process, Phase 5: Slice Task Breakdown. Convert the design for {slice} in project {project} into granular, actionable tasks.
282
-
283
- Your role is Senior AI. Use the following as input:
284
- - The slice design document `user/slices/{slice}.md`.
285
-
286
- Create task file at `user/tasks/{sliceindex}-tasks.{slicename}.md` (where `{sliceindex}` matches the parent slice's index, preserving lineage per `file-naming-conventions.md`).
287
- Use `guide.ai-project.005-task-breakdown` for detailed guidance on this phase.
288
-
289
- Include:
290
- 1. YAML front matter including slice name, project, LLD reference, dependencies, current project state, and status: not_started
291
- 2. Context summary section
292
- 3. Granular tasks following Phase 5 guidelines
293
- 4. Create separate sub-tasks for each similar component.
294
- 5. Organize so that tasks can be completed sequentially.
295
- 6. Test-with pattern: place test tasks immediately after their corresponding implementation tasks, not batched at the end. Each feature or component task should be followed by its test task before moving to the next feature.
296
- 7. Use checklist format for all task files.
297
-
298
- Avoid:
299
- - Time estimates in hours/days/etc. You may use a 1-5 relative effort scale.
300
- - Extensive benchmarking tasks unless actually relevant to this effort.
301
- - Extensive or speculative risk items. Include only if truly relevant.
302
-
303
- For each {tool} in use, consult knowledge in `ai-project-guide/tool-guides/{tool}/`. Follow all task creation guidelines from the Process Guide.
304
-
305
- Each task must be completable by a junior AI with clear success criteria. If insufficient information is available, stop and request clarifying information. Keep files to about 450 lines or less. If considerably more space is needed modify files as detailed here. Do not split a file if it's less than about 100 line overrun.
306
- 1. rename current file nnn-tasks.[task section name]-1.md
307
- 2. add new file nnn-tasks.[task-section-name]-2.md
308
- 3. ...etc...
309
-
310
- Notes:
311
- * This is a project planning task, not a coding task. Code segments should be MINIMAL and kept to only what is necessary to convey information.
312
- * Always use mathematical comparison when evaluating file length vs target size. Always compare vs actual number of lines in the file, not number of list items or checkboxes.
313
- ```
314
-
315
- ##### Implementation (Phase 6)
316
- ```markdown
317
- We are working on {slice} in project {project}, phase 6 of `ai-project-guide/project-guides/guide.ai-project.000-process`.
318
-
319
- Your job is to complete the tasks in the `user/tasks/{sliceindex}-tasks.{slicename}.md` file. Please work through the tasks, following the guidelines in our project guides, and using the relevant provided rules (`rules/`, `CLAUDE.md`, etc). Your role is "Senior AI".
320
-
321
- Use the following as overview input when needed. Primary input is the task file referenced above.
322
- - The slice design at `user/slices/{slice}.md`.
323
-
324
- Commit at each checkpoint marked in the task file (look for lines starting with `**Commit**:`). Use the commit message provided. If a task has no explicit commit marker, commit at the end of the task before moving to the next.
325
-
326
- Work carefully and sequentially through the tasks, ensuring that each task is verified complete before proceeding to the next. You should write unit tests for code as you work through the task. Ensure that tests pass and task is complete before moving to the next.
327
-
328
- If you encounter a failing test, an ambiguous requirement, or a design decision not covered by the slice design, stop and confer with the Project Manager. Do not make more than three attempts at a failing approach before stopping.
329
-
330
- Be sure to check off tasks as they are completed. If a parent slice plan file contains checklist items, check off parent items after all child items are complete. If a `task-checker` tool|agent is available to you, use it.
331
-
332
- After completing all tasks, run through the Verification Walkthrough section of the slice design as a final confirmation. If any step doesn't work as described, stop and confer with Project Manager before marking the slice complete. Update the Verification Walkthrough with actual commands, expected command output, corrections, and any caveats discovered during implementation. The goal is for the walkthrough to be aditionally verifiable by an external agent (human or AI, as applicable).
333
-
334
- Maintain the YAML frontmatter including:
335
- - Status: not_started, in_progress, complete, not_applicable
336
- - Date updated
337
-
338
- Notes:
339
- - Use the task-checker to manage lists if it is available to you.
340
- - Ignore case sensitivity in all file and directory names.
341
- - Use the directory-structure and file-naming-conventions guides.
342
- - If you are missing required information or referenced files, STOP and obtain
343
- from Project Manager (PM).
344
- - Do not guess, assume, or proceed without required files.
345
- ```
346
-
347
- ##### Slice Integration (Phase 7)
348
- We are completing slice integration (Phase 7) for {slice} in project {project}, as described in `ai-project-guide/project-guides/guide.ai-project.000-process`.
349
-
350
- Your role is Senior AI.
351
-
352
- **Integration Steps:**
353
-
354
- 1. **Merge and verify**
355
- - Ensure the slice branch is merged into the main development branch (if using branches)
356
- - Resolve any merge conflicts, preserving slice intent
357
- - Run full test suite — not just slice tests, but project-wide regressions
358
- - Verify build succeeds cleanly
359
-
360
- 2. **Interface verification**
361
- - Confirm that slice dependencies and interfaces work as expected with the integrated codebase
362
- - If this slice exposed new interfaces consumed by future slices, verify they are accessible and correctly typed
363
- - If this slice consumed interfaces from prior slices, confirm integration is clean
364
-
365
- 3. **Documentation update**
366
- - Update any project documentation affected by this slice (README, API docs, architecture docs)
367
- - If the slice introduced new patterns, conventions, or infrastructure, ensure they are documented
368
- - Skip if no documentation is affected — do not create documentation for its own sake
369
-
370
- 4. **Close out**
371
- - Check off the completed slice in the parent slice plan
372
- - Update the slice design document status to `complete`
373
- - Update the task file status to `complete`
374
-
375
- **Notes:**
376
- - If integration reveals issues that require non-trivial fixes, log them to maintenance (`tasks/950-tasks.maintenance.md`) rather than blocking integration
377
- - This phase does not determine what to work on next — workflow navigation is handled by orchestration
378
- - If you cannot verify integration (e.g., missing test infrastructure), note what was verified and what was not
379
-
380
-
381
- ##### Context Initialization
382
- *Use this prompt when you need to switch models or refresh understanding in a project.*
383
- ```markdown
384
- The following provides context on our current work in project {project}.
385
-
386
- Refer to `ai-project-guide/project-guides/guide.ai-project.000-process` for resource structure and locations.
387
-
388
- {{#if fileArch}}Architecture: {fileArch}{{/if}}
389
- {{#if fileSlicePlan}}Slice Plan: {fileSlicePlan}{{/if}}
390
-
391
- Concentrate on the most granular level available (e.g. tasks if present), and use the higher-level files as reference only if needed.
392
-
393
- If you were previously assigned a role, continue in that role. If not, assume role of Senior AI as defined in the Process Guide.
394
-
395
- If tasks file is already present, it should be your primary focus. Slice design may be used to gain overview or as a source for generating tasks. Once we have the tasks, we primarily work from those.
396
-
397
- If given an instruction similar to "process and stand by", make sure you understand all instructions, what files or architecture components are involved, and alert Project Manager to any missing, incomplete, or vague information preventing you from accurately carrying out your instructions. Wait for confirmation from Project Manager before proceeding further.
398
- ```
399
-
400
- ##### Tool Usage
401
- ```markdown
402
- You will need to consult specific knowledge for 3rd party tools, libraries, or packages, which should be available to you in the `ai-project-guide/tool-guides/[tool]/` directory for our curated knowledge. Follow these steps when working with these tools, libraries, or packages. Use proactively.
403
-
404
- 1. Consult Overview: Start with the specific `AI Tool Overview [toolname].md` in the `ai-project-guide/tool-guides/[tool]` directory.
405
- 2. Locate Docs: Scan the Overview for references to more detailed documentation (like local API files under `/documentation`, reference notes, or official web links).
406
- 3. Search Docs: Search within those specific documentation sources first using `grep_search` or `codebase_search`.
407
- 4. Additional documentation. If you have a documentation tool available (ex: context7 MCP) use it for additional information. Always use it if available and no specific tool guide is provided.
408
- 5. Web Search Fallback: If the targeted search doesn't yield results, then search the web.
409
- ```
410
-
411
-
412
- ##### Add Slice Overview
413
- *Use to add a slice overview to an existing slice plan. You should have architecture and slice plan documents associated in order to use this prompt. If these documents are not present, inform the user or agent that required inputs are missing.*
414
-
415
- ###### Inputs & Role
416
- * discovery tool: you should have access to a discovery tool, for example a get_status function or skill (/cf:status or similar). Use this as needed to scan for required inputs and prompt user/agent if any are missing.
417
- * architecture file (arch): associated architecture file
418
- * slice plan file (plan): associated slice plan file
419
- * Your role is Architect as described in the Process Guide.
420
-
421
- ###### Outputs:
422
- * slice plan updated with overview on the new slice.
423
- * slice overview as described here.
424
-
425
- ###### Slice Overview in Slice Plan (required)
426
- Slices created here will normally go in the Feature Slices section of the slice plan. Unless specifically instructed, add new slice to end of Feature Slices list
427
-
428
- *Note: {tsi} in template below is {tentative-slice-index}. Use the next available sequential index and tentative slice index. Do not update index values for additional slices that follow unless asked to do so.*
429
-
430
- *Existing Feature Slices Form*
431
- i. [ ] ** ({tsi}) {Slice Name}** — Brief description. Dependencies: [list]. Risk: Low/Med/High. Effort: n/5
432
-
433
- *Example with New Slice Added*
434
- 14. [ ] **(113) {Slice Name}** — Brief description. Dependencies: [list]. Risk: Low/Med/High. Effort: n/5
435
- 15. [ ] **(114) {New Slice Name}** — Brief description. Dependencies: [list]. Risk: Low/Med/High. Effort: n/5
436
-
437
- ## Integration Work
438
- 16. [ ] **(115) {Name}** — Brief description. Effort: n/5
439
-
440
-
441
- ##### Session State Summary
442
- *Use at the end of any work session — whether a slice is complete, partially complete, or work was interrupted. Produces a DEVLOG entry that enables project resumption by a human or AI in a new session. This is distinct from Summarize Context (above), which preserves state for in-session compaction.*
443
- ```markdown
444
- Write a Session State Summary for project {project}. Append to DEVLOG.md in the project root. Add entry under today's date heading (## YYYYMMDD). If an entry for today already exists, append above it under a new subsection, preserving the reverse chronological order both overall, and within the entries themselves.
445
-
446
- Your role is Senior AI.
447
-
448
- **If a slice was completed:**
449
- ###### Slice nnn: {Slice Name} — Complete
450
- Include:
451
- - Commits made during this slice (short hash + one-line description, table or list)
452
- - What works: build status, test results, verified functionality
453
- - What's pending: manual verification, known issues, deferred items
454
- - Issues logged to maintenance (file reference + brief description)
455
- - Key implementation decisions or surprises worth noting for future context
456
-
457
- **If work is in progress (mid-slice or mid-task):**
458
- ###### Slice nnn: {Slice Name} — In Progress
459
- Include:
460
- - Current task and subtask (reference the task file and specific item)
461
- - What's been completed so far in this session
462
- - Commits made during this session (if any)
463
- - Blockers or open questions for Project Manager
464
- - Key decisions made during the session
465
- - State needed to resume: which task, what file, any important context
466
-
467
- **If design or planning work was completed (no implementation):**
468
- ###### Slice nnn: {Slice Name} — Design Complete
469
- Include:
470
- - Documents created or updated (file paths)
471
- - Key design decisions and rationale
472
- - Scope summary (what the design covers)
473
- - Notable findings (broken imports, gaps discovered, deferred items)
474
-
475
- **Guidelines:**
476
- - Keep it concise — this will be used as input for context assembly on the next session
477
- - Do not include full code listings or verbose explanations
478
- - Focus on: state, decisions, and continuation context
479
- - If tests are relevant, include pass/fail counts and note any failures with brief descriptions
480
- - Reference file paths for any issues logged to maintenance or other task files
481
- - Do not include "next steps" or "next slice" — workflow navigation is handled by orchestration, not DEVLOG
482
- - This is a documentation task, not a coding task
483
-
484
- **DEVLOG.md format:**
485
- If DEVLOG.md does not exist, create it at project-root directory with the following structure:
486
-
487
- # Development Log
488
- A lightweight, append-only record of development activity. Newest entries first.
489
- Format: `## YYYYMMDD` followed by brief notes (1-3 lines per session).
490
- ---
491
-
492
- ## YYYYMMDD
493
- ### Slice nnn: {Slice Name} — {Status}
494
- - {concise session notes as described above}
495
- ```
496
-
497
- ##### Maintenance Task
498
- ```markdown
499
- Operate as a Senior AI. Use the issue description provided, and add tasks to the maintenance file to address implementation of the issue. Use a maintenance task and slice file in the 950-999 range. Add a concise description in the slist file and add a new task to the task file. Use an existing slice and task file in the maintenance range if present and the item is small enough to represent as a single main task. Create new files if needed.
500
-
501
- Example files:
502
- `slices/950-slices.maintenance.md`
503
- `tasks/950-tasks.maintenance.md`
504
-
505
- Include:
506
- 1. A new Task {n}
507
- 2. A very brief overview of the task (you may modify if already present).
508
- 3. Granular but concise subtasks following Phase 5 guidelines
509
- 4. Organize so that subtasks can be completed sequentially.
510
- 5. Optimize for early vertical slice testability.
511
- 6. Use checklist format for all tasks.
512
-
513
- Avoid:
514
- - Time estimates for subtasks. If work is that complex, this is wrong format.
515
- - Benchmarking tasks unless actually relevant to this effort.
516
- - Risk items. Include only if truly relevant. Be skeptical here.
517
-
518
- For each {tool} in use, consult knowledge in `ai-project-guide/tool-guides/{tool}/`. Follow all task creation guidelines from the Process Guide.
519
-
520
- Each task must be completable by a junior AI with clear success criteria. If insufficient information is available, stop and request clarifying information.
521
-
522
- This is a project planning task, not a coding task.
523
- ```
524
-
525
- ##### Maintenance Routine
526
- ```markdown
527
- We are performing routine maintenance by implementing solutions for incomplete tasks in the maintenance task file. Unless otherwise specified, use file `tasks/950-tasks.maintenance.md` and scan for incomplete tasks. If given a particular section heading in the file, consider only that section.
528
-
529
- Work through maintenance items one at a time. For each item:
530
- - Determine if task can reasonably be solved without expansion or creating more detailed tasks. Keep a list of anything requiring this additional detail and present it to the Project Manager after proceeding through all solvable items.
531
- - Implement solutions according to our project guidelines. Ensure that you create unit tests for each solution, and that the tests pass before proceeding to the next item. Create tests as you work through each item -- do not wait until the end and try to create them all.
532
- - Run regressions and existing tests to make sure maintenance fixes do not break any existing slices, slice boundaries, dependencies, or interfaces.
533
- - Update tasks and check off as you go. Use a task-checker agent if one is configured.
534
-
535
- Current project: {project}
536
- Active slice work: {slice} (if applicable)
537
- ```
538
-
539
- ##### Analysis Processing
540
- ```markdown
541
- We need to process the artifacts from our recent code analysis.
542
-
543
- Role: Senior AI, processing analysis results into actionable items
544
- Context: Analysis has been completed on {project} (optionally {subproject}) and findings need to be converted into proper maintenance tasks, code review issues, or GitHub issues as appropriate.
545
-
546
- Notes:
547
- - Be sure to know the current date first. Do not assume dates based on training
548
- data timeframes.
549
-
550
- Process:
551
- 1. Categorize Findings:
552
- - P0 Critical: Data loss, security vulnerabilities, system failures
553
- - P1 High: Performance issues, major technical debt, broken features
554
- - P2 Medium: Code quality, maintainability, best practices
555
- - P3 Low: Optimizations, nice-to-have improvements
556
-
557
- 2. Create File and Document by Priority:
558
- - Create markdown file `analysis/nnn-analysis.{project-name}{.subproject?}.md`
559
- where nnn starts at 940 (analysis range).
560
- - Note that subproject is often not specified. Do not add its term to the name
561
- if this is the case.
562
- - Divide file into Critical Issues (P0/P1) and Additional Issues(P2/P3)
563
- - Add concise documentation of each issue -- overview, context, conditions.
564
-
565
- 3. File Creation Rules:
566
- - Use existing file naming conventions from `file-naming-conventions.md`
567
- - Include YAML front matter for all created files
568
- - Add the correct date (YYYYMMDD) in the file's frontmatter
569
- - Reference source analysis document (if applicable)
570
- - Add line numbers and specific locations where applicable
571
-
572
- 4. GitHub Integration (if available):
573
- - Create GitHub issues for P0/P1 items
574
- - Label appropriately: `bug`, `critical`, `technical-debt`, `analysis`
575
- - Reference analysis document in issue description
576
- - Include reproduction steps and success criteria
577
- ```
578
-
579
- ##### Analysis Task Creation
580
-
581
- *Create tasks based on codebase analysis. While we don't yet have a generic analysis prompt, we do have the following modified task-creation prompt for use with analysis results.*
582
- ```markdown
583
- We're working in our guide.ai-project.000-process, Phase 5: Slice Task Breakdown. Convert the issues from {analysis-file} into granular, actionable tasks if they are not already. Keep them in priority order (P0/P1/P2/P3).
584
-
585
- If the tasks are already sufficiently granular and in checklist format, you do not need to modify them. Note that each success criteria needs a checkbox.
586
-
587
- Your role is Senior AI. Use the specified analysis document `user/analysis/nnn-analysis.{project-name}{.subproject?}.md` as input. Note that subproject is optional (hence the ?). Avoid adding extra `.` characters to filename if subproject is not present.
588
-
589
- Create task file at `user/tasks/nnn-analysis{.subproject?}-{date}.md` with:
590
- 1. YAML front matter including slice or subproject name, project, YYYYMMDD date, main analysis file reference, dependencies, and current project state
591
- 2. Context summary section
592
- 3. Granular tasks following Phase 5 guidelines
593
- 4. Keep success criteria with their respective task
594
- 5. Always use checklist format described in guide.ai-project.000-process under Task Files.
595
-
596
- For each {tool} in use, consult knowledge in `ai-project-guide/tool-guides/{tool}/`. Follow all task creation guidelines from the Process Guide.
597
-
598
- Each task must be completable by a junior AI with clear success criteria. If insufficient information is available, stop and request clarifying information.
599
-
600
- This is a project planning task, not a coding task.
601
- ```
602
-
603
- ##### Analysis to LLD
604
- *Note: this is rarely used and should normally be addressed using the standard architectural component → slice plan → slices methodology.*
605
- ```markdown
606
- We need to create a Low-Level Design (LLD) for {component} identified during codebase analysis or task planning in project {project}. It may be an expansion of an initial task section identified during analysis.
607
-
608
- Your role is Architect as described in the Process Guide. This LLD will bridge the gap between high-level understanding and implementable tasks.
609
-
610
- Context:
611
- - Analysis document: `user/analysis/nnn-analysis.{project-name}{.subproject or analysis topic?}` (or specify location)
612
- - Related task file: `user/tasks/nnn-analysis{.subproject?}-{date}.md` (if exists)
613
- - Current issue: {brief description of what analysis revealed}
614
-
615
- Create LLD document at: `user/slices/nnn-slice.{slice-name}.md`
616
-
617
- Required YAML front matter:
618
- ```yaml
619
- ---
620
- layer: project
621
- docType: slice-design
622
- slice: {slice-name}
623
- project: {project}
624
- triggeredBy: analysis|task-breakdown|architecture-review
625
- sourceDocument: {path-to-analysis-or-task-file}
626
- dependencies: [list-any-prerequisites]
627
- affects: [list-components-or-slices-impacted]
628
- complexity: low|medium|high
629
- dateCreated: YYYYMMDD
630
- dateUpdated: YYYYMMDD
631
- status: not_started
632
- ---
633
-
634
- Guidelines for creating LLD:
635
-
636
- Cross-Reference Requirements:
637
-
638
- - Update source analysis/task document to reference this LLD
639
- - Add back-reference in this LLD to triggering document
640
- - Note any slice designs or existing slices this affects
641
-
642
- Focus Areas:
643
-
644
- - Keep design concrete and implementation-ready
645
- - Include code examples or pseudocode where helpful
646
- - Reference specific files, classes, or components by name
647
- - Address both immediate needs and future extensibility
648
-
649
- If you need more context about the analysis findings or existing system architecture, stop and request from Project Manager.
650
-
651
- Note: This creates implementation-ready technical designs, not high-level planning documents.
652
- ```
653
-
654
- ##### Analysis Task Implementation
655
- *Phase 6 Task Implementation customized for analysis files.*
656
- ```markdown
657
- We are working on the analysis file {analysis} in project {project}, phase 6 of `ai-project-guide/project-guides/guide.ai-project.000-process`.
658
-
659
- Your role is "Senior AI". Your job is to complete the tasks in the `user/tasks/nnn-analysis-{topic}.md` file. Please work through the tasks, following the guidelines in our project guides, and using the rules in the rules/ directory.
660
-
661
- The analysis overview is available at {analysis} for additional context.
662
-
663
- STOP and confer with Project Manager after each task, unless directed otherwise by the Project Manager. Do not update any progress files until confirmation from Project Manager.
664
-
665
- Work carefully and ensure that each task is verified complete before proceeding to the next. If an attempted solution does not work or you find reason to try another approach, do not make more than three attempts without stopping and obtaining confirmation from Project Manager.
666
-
667
- Check off completed tasks in the task file when verified complete. When all tasks are complete, proceed to Phase 7 (integration) with Project Manager approval.
668
-
669
- Notes:
670
- * Use the task-checker to manage lists if it is available to you
671
- * Ignore case sensitivity in all file and directory names
672
- * If you cannot locate referenced files, STOP and request information from Project Manager
673
- * Do not guess, assume, or proceed without required files.
674
- ```
675
-
676
- ##### Analyze Codebase
677
- *This is mostly specialized to front-end and web apps and should be moved to a specific guide.*
678
- ```markdown
679
- Purpose: Perform discovery analysis of existing codebase to:
680
- - Document system architecture and technology stack
681
- - Identify technical debt and improvement opportunities
682
- - Provide foundation for creating architectural components, slices, or maintenance tasks
683
- - Create reference documentation for team members
684
-
685
- This is reconnaissance work - not goal-oriented development.
686
-
687
- Analyze the following existing codebase and document your findings. We want this to not only assist ourselves in updating and maintaining the codebase, but also to assist humans who may be working on the project.
688
-
689
- ###### Expected Output
690
- * Document your findings in `user/analysis/nnn-analysis.{topic}.md` where:
691
- - nnn starts at 940 (analysis range)
692
- - {topic} describes the analysis focus (e.g., "initial-codebase", "dependency-audit", "architecture-review")
693
- * Write in markdown format, following our rules for markdown output.
694
-
695
- ###### General Guidelines
696
- * Document the codebase structure. Also note presence of any project-documents or similar folders which probably contain information for us.
697
- * Document presence or average of tests, and an estimate of coverage if tests are present.
698
- * Identify technologies and frameworks in use.
699
- * What package managers are in use?
700
- * Is there a DevOps pipeline indicated?
701
- * Analysis should be concise and relevant - no pontificating.
702
- * Add note in README as follows: Claude: please find code analysis details in {file mentioned above}.
703
-
704
- ###### Front End
705
- * If this is a JS app, does it use React? Vue? Is it NextJS? Is it typescript, javascript, or both? Does it use TailWind? ShadCN? Something else?
706
-
707
- ###### NextJS, React
708
- * Perform standard analysis and identify basic environment -- confirm NextJS, identify common packages in use (Tailwind, ShadCN, etc) and any unusual packages or features.
709
- * If auth is present, attempt to determine its structure and describe its methodology
710
- * Is the project containerized?
711
- * If special scripts (ex: 'docker: {command}') are present, document them in the README.
712
- * Provide a description of the UI style, interactivity, etc
713
- * Document page structure.
714
- * What type of architecture is used to manage SSR vs CSR?
715
-
716
- ###### Tailwind
717
- * Is cn used instead of string operations with parameterized or variable classNames?
718
- * Prefer Tailwind classes, there should not be custom CSS classes.
719
- * If this is Tailwind 4, are customizations correctly in CSS and no attempt to use tailwind.config.ts/.js.
720
-
721
- ```
722
-
723
- ##### Custom Instruction
724
- *Used as a placeholder by context-builder app*
725
- ```markdown
726
- Custom instructions apply. See Additional Context for instruction prompt.
727
- ```
728
-
729
- ##### Task Expansion (Variant: Phase 5))
730
- *This is no longer a separate phase. Use only when task breakdown results need additional enhancement, which is uncommon. See `guide.ai-project.005-variant-task-expansion` for detailed guidance.*
731
-
732
- ```markdown
733
- We're working in our guide.ai-project.000-process, Phase 5 (optional task expansion). Enhance the tasks for slice {slice} in project {project} to improve the chances that our "junior" AI workers can complete assigned tasks on their own. Only enhance tasks that can truly benefit from it. Many tasks may already be described with sufficient detail.
734
-
735
- Use `guide.ai-project.005-variant-task-expansion` as your detailed guide. Work on the task file `user/tasks/{sliceindex}-tasks.{slicename}.md`.
736
-
737
- Your role is Senior AI. For each task:
738
- - If it would benefit from expansion or subdivision, enhance it.
739
- - If it's already appropriate, output it verbatim.
740
- - Ensure all tasks are accounted for.
741
-
742
- Additionally:
743
- - Make sure that you do NOT use this expansion as a way to write code in a design and planning phase. Expanded tasks should not look like writing code for the the tasks. You may spec out interfaces or use minimal code examples where truly useful. Evaluate carefully before doing so.
744
-
745
- After any expansion, review it against the original unexpanded task and ensure that your expansion is a detailed representation of the original task, not a reinterpretation or change of the original task.
746
-
747
- Output results by updating the existing task file. Success: All tasks have been processed and either output as is, or enhanced and divided into further subtasks.
748
-
749
- Note: This is a project planning task, not a coding task.
750
- ```
751
-
752
-
753
- ***
754
- ### Experimental
755
- *Less than no guarantees here. Generally promoted to active, or deprecated.*
756
-
757
- ***
758
- ### Deprecated
759
-
760
- ##### Summarize Context
761
- *Use when nearing context limit, e.g. when facing imminent auto-compaction in Claude Code. Make sure to include inside `[ ]` or Claude will ignore the instructions.*
762
-
763
- ```markdown
764
- Perform the following items and add their output to the compacted context:
765
- * Preserve the initial context describing what we are working on.
766
- * Summarize current project state at time of this compaction.
767
- * Include any open todo list items and work in progress.
768
- * add the tag --COMPACTED-- after inserting this information.
769
- ```
770
-
771
- ##### Task Breakdown (Supplement: Phase 5)
772
- *Add this when you have a detailed slice design especially one containing code that may have been iterated on in order to solve complex or subtle design problems.*
773
-
774
- ```markdown
775
- ###### Important Additional Information
776
- Note that our slice design is intricate, detailed, and has been refined extensively in order to address complex and/or subtle issues. The slice design contains code, and we *need* to use this code in our task planning.
777
-
778
- As you are planning tasks, proceed *carefully* through the slice design, creating tasks to accomplish the design *exactly* as presented. Once you complete the task breakdown, review it in light of the slice design to ensure that:
779
- 1. You completely addressed the design. If there are similar items, for example numerous wrapper components, ensure that your tasks explicitly address creation of each one.
780
- 2. You did not miss any details. This is critical. Do not "gloss over", simplify, or add workarounds to any coding sections of the design even though they may be difficult.
781
-
782
- Note also that tasks may reference the relevant design document. You do not need to replicate large pieces of the design document all over the task list. Ensure that references are accurate. Do not assume or guess anywhere in this task.
783
-
784
- After creation of task list, you must review the entire list against the slice design to ensure that these requirements are met.
785
- ```
786
-
787
-